Part Number Hot Search : 
N3053 0592M BAS16W HD74C V47ZS7 93C46A TLP561J 133AX
Product Description
Full Text Search
 

To Download TMP92CD54IFG Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
) bits are cleared to 0. when the can controller exits from sleep mode, the bit in the mcr register and the bit in the gsr register are cleared to 0. if sleep mode is requested (mcr=1) when the can controller is transmitting a message, it enters the sleep mode after either condition as follows: z the can controller completes the transmission successfully. z after arbitration lost, the can controller completes the reception of a message successfully. z after arbitration lost, the can contro ller detects an error on the can bus during the reception of a message. (3) halt mode writing a 1 to the bit in the mcr register request a transition to halt mode. when the can controller enters halt mode, the bit in the gsr register is set to 1. in halt mode, the can controller transmits or receives no messages but it is still active on the can bus and can transmit error flags and acknowledge signals. resetting the mcr bit to 0 causes the can controller to exit from halt mode. if halt mode is requested (mcr=1) wh en the can controller is transmitting a message, it enters the halt mode after either condition as follows: z the can controller completes the transmission successfully. z the can controller detects arbitration lost. (4) test loopback mode in this mode, the can controller receives a message it has transmitted and also generates acknowledge signals. this mode requires only connection to the rx and tx pins and no other can devices. the can controller transmits a message from one mailbox and receives it to another mailbox. mailbox settings are the same as those used in normal operation mode. test loopback mode can only be enabled or disabled in configuration mode. see the flowchart for setting test loopback and test error modes in figure 3.12.37.
tmp92cd54i 2009-12-26 92cd54i-255 tentative (5) test error mode the error counter can be written in this mode only. the values of the lower eight bits are written to both tec and rec simultaneously. the maximum value that can be written is 255. a count value of 256, whic h places the can controller in the bus-off mode, cannot be written. test error mode can only be enabled or disabled in configuration mode. see the flowchart for setting test loopback and test error modes in figure 3.12.37. enable / disable test loop back mode / test error mode normal operation mode = 0, = 0 configuration mode request set to 1 = 1? no yes set-up / 0: disable 1: enable normal operation mode request set to 0 no = 0? yes end of set-up normal operation mode figure 3.12.37 flowchart of the test loop back mode / the test error mode set-up
tmp92cd54i 2009-12-26 92cd54i-256 tentative 3.12.5 description of operation (1) transmission mode figure 3.12.38 shows an example messa ge transmission flowchart using a transmission completion interrupt, intct. polling can also be used in place of an interrupt. in that case, the step "transmit interrupt occurred?" is replaced with " = 1?" and the steps "write 1 to " and "clear " are not required. set-up message transmitting message transmission yes new setup? set to 0 no no set to 0 update mailbox data? setup id, yes to mailbox ?n? write new data setup no transmission request? set to 1 yes set to 1 set to 1 end of setup no transmit interrupt generated? yes check special user tasks (update mailbox data) clear , reti figure 3.12.38 flowchart of message transmission (example)
tmp92cd54i 2009-12-26 92cd54i-257 tentative (2) reception mode when the can controller receives a message on the can bus, it stores the message into the receive buffer. the id of the message stored in the receive buffer is compared with the ids of mailboxes. if the mbnmi0h< game>/ bit is set to 1, they are compared using the global/local receive mask register, gam/lam. if one of the following conditions is satisfied, subsequent ids are not compared: ? a data frame matches the id of the receive mailbox. ? a remote frame matches the id of the receive mailbox. ? a remote frame matches the id of the transmit mailbox for which the bit is set to 1. the minimum time between the rmp bit being set to 1 and a next receive message being stored into a mailbox depends on the bit time setting. if the data length code is 0, the minimum time is as follows: ? standard format: 47-bit time ? 16 f io ? extended format: 67-bit time ? 16 f io
tmp92cd54i 2009-12-26 92cd54i-258 tentative a data frame figure 3.12.39 shows an example message reception flowchart using a reception completion interrupt, intcr. polling can also be used in place of an interrupt. in that case, the step "receive interrupt occurred?" is replaced with " = 1?" and the steps "write 1 to " and "clear " are not required. setup for message receiving message reception yes new setup? set to 0 no set to 1 receive interrupt generated? no yes setup id, check to mailbox ?n? note1 and if necessary, read out the mailbox n set / setup lam/gam yes no = 1? set to 1 message lost note2 clear (the data that was read out the mailbox n was invalid.) set to 1 clear clear note2 end of setup note2 clear reti note 1: always check and . note 2: after the step "clear ", if a message is received in mailbox n before is cleared, may be set back to 1 ( = 0). figure 3.12.39 flowchart of message reception (example)
tmp92cd54i 2009-12-26 92cd54i-259 tentative b remote frame figure 3.12.40 shows an example flowchart for processing a remote frame using the automatic response function. th is function is enabled when the bit for a transmit mailbox is set to 1. to prevent a data mismatch, update data in the mailbox by using the cdr register to control transmission. automatic reply to remote frames setup a mailbox for automatic reply to remote frame yes new setup? set to 0 no no set to 0 update mailbox data? yes change data requested: set to 1 setup id, set to 1 to mailbox ?n? write new data to the mailbox if necessary, set setup gam end of change data: set to 0 setup set to 1 end of setup figure 3.12.40 flowchart of remote frame handl ing with the automatic reply feature (example)
tmp92cd54i 2009-12-26 92cd54i-260 tentative 3.13 analog-to-digital converter the tmp92cd54i incorporates a 10-bit successive approximation analog-to-digital converter (ad converter) with 12 analog input channels. the following shows a block diagram of the ad converter. the 12 analog input pins (an0-an11) are shared with input-only ports g and l so that they can also be used as input ports. note: to reduce supply current in idle2, idle 1, idle3, or stop mode, ensure that the ad converter is not operating before attempting to execute the halt in struction because the device may enter a standby mode with the internal comparator still enabled depending on the timing. intad interrupt an11 (pl3) an10 (pl2) an9 (pl1) an8 (pl0) an7 (pg7) an6 (pg6) an5 (pg5) an4 (pg4) an3 (pg3) an2 (pg2) an1 (pg1) an0 (pg0) comparator vrefh vrefl multiplexer sample and hold ad mode control register 1 admod1 scan repeat interrupt busy end start + ? internal data bus decoder ad mode control register 0 admod0 ad conversion result register adreg0l to adregbl adreg0h to adregbh da converter ad converter control circuit channel select a nalog input r c figure 3.13.1 block diagr am of ad converter
tmp92cd54i 2009-12-26 92cd54i-261 tentative 3.13.1 analog-to-digital converter registers the ad converter is controlled using two ad mode control re gisters (admod0 and admod1). the results of ad conversion are stored in 12 pairs of ad conversion result upper/lower registers (adreg0h /l to adregbh/l). the follow ing describes the registers related to the ad converter. ad mode control register 0 7 6 5 4 3 2 1 0 bit symbol eocf adbf ? ? itm0 repeat scan ads read/write r r/w after reset 0 0 0 0 0 0 0 0 function ad conversion end flag 0: conversion in progress 1: conversion complete ad conversion busy flag 0: conversion stopped 1: conversion in progress note: always fixed to 0 note: always fixed to 0 interrupt specification in conversion channel fixed repeat mode 0: every conversion 1: every fourth conversion repeat mode specification 0: single conversion 1: repeat conversion mode scan mode specification 0: conversion channel fixed mode 1: conversion channel scan mode ad conversion start 0: don?t care 1: start conversion always 0 when read ad conversion start 0don?t care 1 start ad conversion note: always read as 0. ad scan mode setting 0 ad conversion channel fixed mode 1 ad conversion channel scan mode ad repeat mode setting 0 ad single conversion mode 1 ad repeat conversion mode specify ad conversion interrupt for channel fixed repeat conversion mode channel fixed repeat conversion mode = ?0?, = ?1? 0 generates interrupt every conversion. 1 generates interrupt every fourth conversion. ad conversion busy flag 0 ad conversion stopped 1 ad conversion in progress ad conversion end flag 0 before or during ad conversion 1 ad conversion complete admod0 (0138h) figure 3.13.2 ad converter related register
tmp92cd54i 2009-12-26 92cd54i-262 tentative ad mode control register 1 7 6 5 4 3 2 1 0 bit symbol vrefon i2ad adch3 adch2 adch1 adch0 read/write r/w r/w r/w after reset 0 0 0 0 0 0 0 0 function vref application control 0: off 1: on idle2 0: stop 1: operate note: always fixed to 0 note: always fixed to 0 analog input channel selection analog input channel selection 0 channel fixed 1 channel scanned 0000 an0 an0 0001 an1 an0 an1 0010 an2 an0 an1 an2 0011 an3 an0 an1 an2 an3 0100 an4 an0 an1 an2 an3 an4 0101 an5 an0 an1 an2 an3 an4 an5 0110 an6 an0 an1 an2 an3 an4 an5 an6 0111 an7 an0 an1 an2 an3 an4 an5 an6 an7 1000 an8 an0 an1 an2 an3 an4 an5 an6 an7 an8 1001 an9 an0 an1 an2 an3 an4 an5 an6 an7 an8 an9 1010 an10 an0 an1 an2 an3 an4 an5 an6 an7 an8 an9 an10 1011 an11 an0 an1 an2 an3 an4 an5 an6 an7 an8 an9 an10 an11 1100, 1101, 1110, 1111 (reserved) (reserved) idle2 control 0 stopped 1 in operation control of application of reference voltage to ad converter 0 off 1on before starting conversion (before writing 1 to admod0 ), set the bit to 1. admod1 (0139h) figure 3.13.3 ad converter related register
tmp92cd54i 2009-12-26 92cd54i-263 tentative ad conversion result register 0 low 7 6 5 4 3 2 1 0 bit symbol adr01 adr00 adr0rf read/write r r after reset undefined - - - - - 0 function stores lower 2 bits of ad conversion result ad conversion data storage flag 1: conversion result stored ad conversion result register 0 high 7 6 5 4 3 2 1 0 bit symbol adr09 adr08 adr07 adr06 adr05 adr04 adr03 adr02 read/write r after reset undefined function stores upper eight bits ad conversion result. ad conversion result register 1 low 7 6 5 4 3 2 1 0 bit symbol adr11 adr10 adr1rf read/write r r after reset undefined - - - - - 0 function stores lower 2 bits of ad conversion result ad conversion result flag 1: conversion result stored ad conversion result register 1 high 7 6 5 4 3 2 1 0 bit symbol adr19 adr18 adr17 adr16 adr15 adr14 adr13 adr12 read/write r after reset undefined function stores upper eight bits of ad conversion result. 9 8 76543210 channel x conversion result 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 adreg0l (0120h) adreg0h (0121h) adreg1l (0122h) adreg1h (0123h) a dregxh adregxl ? bits 5 to 1 are always read as 1. ? bit 0 is the ad conversion storage flag . it is set to 1 when a ad conversion value has been stored. reading either of the registers (adregxh or adregxl) causes the corresponding flag to be creared to 0. figure 3.13.4 ad converter related registers
tmp92cd54i 2009-12-26 92cd54i-264 tentative ad conversion result register 2 low 7 6 5 4 3 2 1 0 bit symbol adr21 adr20 adr2rf read/write r r after reset undefined - - - - - 0 function stores lower 2 bits of ad conversion result. a/d conversion data storage flag 1: conversion result stored ad conversion result register 2 high 7 6 5 4 3 2 1 0 bit symbol adr29 adr28 adr27 adr26 adr25 adr24 adr23 adr22 read/write r after reset undefined function stores upper eight bits of ad conversion result. ad conversion result register 3 low 7 6 5 4 3 2 1 0 bit symbol adr31 adr30 adr3rf read/write r r after reset undefined - - - - - 0 function stores lower 2 bits of ad conversion result. ad conversion data storage flag 1: conversion result stored ad conversion result register 3 high 7 6 5 4 3 2 1 0 bit symbol adr39 adr38 adr37 adr36 adr35 adr34 adr33 adr32 read/write r after reset undefined function stores upper eight bits of ad conversion result. 9 8 76543210 channel x conversion result 7 6 543210 76543 2 1 0 adreg2l (0124h) adreg2h (0125h) adreg3l (0126h) adreg3h (0127h) a dregxh adregxl ? bits 5 to 1 are always read as 1. ? bit 0 is the ad conversion result storage flag . it is set to 1 when a ad conversion value has been stored. reading either of the registers (adregxh or adregxl) causes the corresponding flag to be cleared to 0. figure 3.13.5 ad converter related registers
tmp92cd54i 2009-12-26 92cd54i-265 tentative ad conversion result register 4 low 7 6 5 4 3 2 1 0 bit symbol adr41 adr40 adr4rf read/write r r after reset undefined - - - - - 0 function stores lower 2 bits of ad conversion result. a/d conversion data storage flag 1: conversion result stored ad conversion result register 4 high 7 6 5 4 3 2 1 0 bit symbol adr49 adr48 adr47 adr46 adr45 adr44 adr43 adr42 read/write r after reset undefined function stores upper eight bits of ad conversion result. ad conversion result register 5 low 7 6 5 4 3 2 1 0 bit symbol adr51 adr50 adr5rf read/write r r after reset undefined - - - - - 0 function stores lower 2 bits of ad conversion result. ad conversion data storage flag 1: conversion result stored ad conversion result register 5 high 7 6 5 4 3 2 1 0 bit symbol adr59 adr58 adr57 adr56 adr55 adr54 adr53 adr52 read/write r after reset undefined function stores upper eight bits of ad conversion result. 9 8 76543210 channel x conversion result 7 6 543210 76543 2 1 0 adreg4l (0128h) adreg4h (0129h) adreg5l (012ah) adreg5h (012bh) a dregxh adregxl ? bits 5 to1 are always read as 1. ? bit 0 is the ad conversion result storage flag . it is set to 1 when a ad conversion value has been stored. reading either of the registers (adregxh or adregxl) causes the corresponding flag to be cleared to 0. figure 3.13.6 ad converter related registers
tmp92cd54i 2009-12-26 92cd54i-266 tentative ad conversion result register 6 low 7 6 5 4 3 2 1 0 bit symbol adr61 adr60 adr6rf read/write r r after reset undefined - - - - - 0 function stores lower 2 bits of ad conversion result. a/d conversion data storage flag 1: conversion result stored ad conversion result register 6 high 7 6 5 4 3 2 1 0 bit symbol adr69 adr68 adr67 adr66 adr65 adr64 adr63 adr62 read/write r after reset undefined function stores upper eight bits of ad conversion result. ad conversion result register 7 low 7 6 5 4 3 2 1 0 bit symbol adr71 adr70 adr7rf read/write r r after reset undefined - - - - - 0 function stores lower 2 bits of ad conversion result. ad conversion data storage flag 1: conversion result stored ad conversion result register 7 high 7 6 5 4 3 2 1 0 bit symbol adr79 adr78 adr77 adr76 adr75 adr74 adr73 adr72 read/write r after reset undefined function stores upper eight bits of ad conversion result. 9 8 76543210 channel x conversion result 7 6 543210 76543 2 1 0 adreg6l (012ch) adreg6h (012dh) adreg7l (012eh) adreg7h (012fh) a dregxh adregxl ? bits 5 to 1 are always read as 1. ? bit 0 is the ad conversion result storage flag . it is set to 1 when a ad conversion value has been stored. reading either of the registers (adregxh or adregxl) causes the corresponding flag to be cleared to 0. figure 3.13.7 ad converter related registers
tmp92cd54i 2009-12-26 92cd54i-267 tentative ad conversion result register 8 low 7 6 5 4 3 2 1 0 bit symbol adr81 adr80 adr8rf read/write r r after reset undefined - - - - - 0 function stores lower 2 bits of ad conversion result. a/d conversion data storage flag 1: conversion result stored ad conversion result register 8 high 7 6 5 4 3 2 1 0 bit symbol adr89 adr88 adr87 adr86 adr85 adr84 adr83 adr82 read/write r after reset undefined function stores upper eight bits of ad conversion result. ad conversion data register 9 low 7 6 5 4 3 2 1 0 bit symbol adr91 adr90 adr9rf read/write r r after reset undefined - - - - - 0 function stores lower 2 bits of ad conversion result. ad conversion data storage flag 1: conversion result stored ad conversion result register 9 high 7 6 5 4 3 2 1 0 bit symbol adr99 adr98 adr97 adr96 adr95 adr94 adr93 adr92 read/write r after reset undefined function stores upper eight bits of ad conversion result. 9 8 76543210 channel x conversion result 7 6 543210 76543 2 1 0 adreg8l (0130h) adreg8h (0131h) adreg9l (0132h) adreg9h (0133h) a dregxh adregxl ? bits 5 to 1 are always read as 1. ? bit 0 is the ad conversion result storage flag . it is set to 1 when a ad conversion value has been stored. reading either of the registers (adregxh or adregxl) causes the corresponding flag to be cleared to 0. figure 3.13.8 ad converter related registers
tmp92cd54i 2009-12-26 92cd54i-268 tentative ad conversion result register a low 7 6 5 4 3 2 1 0 bit symbol adra1 adra0 adrarf read/write r r after reset undefined - - - - - 0 function stores lower 2 bits of ad conversion result. a/d conversion data storage flag 1: conversion result stored ad conversion result register a high 7 6 5 4 3 2 1 0 bit symbol adra9 adra8 adra7 adra6 adra5 adra4 adra3 adra2 read/write r after reset undefined function stores upper eight bits of ad conversion result. ad conversion result register b low 7 6 5 4 3 2 1 0 bit symbol adrb1 adrb0 adrbrf read/write r r after reset undefined - - - - - 0 function stores lower 2 bits of ad conversion result. ad conversion data storage flag 1: conversion result stored ad conversion result register b high 7 6 5 4 3 2 1 0 bit symbol adrb9 adrb8 adrb7 adrb6 adrb5 adrb4 adrb3 adrb2 read/write r after reset undefined function stores upper eight bits of ad conversion result. 9 8 76543210 channel x conversion result 7 6 543210 76543 2 1 0 adregal (0134h) adregah (0135h) adregbl (0136h) adregbh (0137h) a dregxh adregxl ? bits 5 to 1 are always read as 1. ? bit 0 is the ad conversion result storage flag . it is set to 1 when a ad conversion value has been stored. reading either of the registers (adregxh or adregxl) causes the corresponding flag to be cleared to 0. figure 3.13.9 ad converter related registers
tmp92cd54i 2009-12-26 92cd54i-269 tentative 3.13.2 description of operation (1) analog reference voltage the high level of the analog reference voltage is applied to the vrefh pin and the low level applied to the vrefl pin. the reference voltage across vrefh and vrefl is divided by 1024 using string resistors. th e divided voltages are compared with the analog input voltage to perform ad conversion. writing a 0 to the admod1 bit causes the switch between vrefh and vrefl to be turned off. to start ad conver sion when the switch is turned off, first write a 1 to , then wait for 3 s (independent of the system clock frequency fc) until the internal reference voltage settles before writing a 1 to admod0. (2) selecting an analog input channel how to select an analog input channel depends on the ad converter operating mode. ? when using a fixed analog inpu t channel (admod0 = 0) use settings in admod1 to select one of the an0 to an11 analog input pins. ? when scanning through analog input channels (admod0 = 1) use settings in admod1 to select one of the 12 scan modes. table 3.13.1 shows the selection of analog input channels in each operating mode. upon a reset, admod0 and admod1 are initialized to 0 and 0000, respectively, so that channel fixed inpu t using the an0 pin is selected. pins that are not used as an analog input channel can be used as ordinary input ports. (see "3.5.7 port g" and "3.5.8 port l.") table 3.13.1 analog input channel selection channel fixed = ?0? channel scan = ?1? 0000 an0 an0 0001 an1 an0 an1 0010 an2 an0 an1 an2 0011 an3 an0 an1 an2 an3 0100 an4 an0 an1 an2 an3 an4 0101 an5 an0 an1 an2 an3 an4 an5 0110 an6 an0 an1 an2 an3 an4 an5 an6 0111 an7 an0 an1 an2 an3 an4 an5 an6 an7 1000 an8 an0 an1 an2 an3 an4 an5 an6 an7 an8 1001 an9 an0 an1 an2 an3 an4 an5 an6 an7 an8 an9 1010 an10 an0 an1 an2 an3 an4 an5 an6 an7 an8 an9 an10 1011 an11 an0 an1 an2 an3 an4 an5 an6 an7 an8 an9 an10 an11 1100 1111 invalid invalid
tmp92cd54i 2009-12-26 92cd54i-270 tentative (3) starting ad conversion setting admod0 to 1 starts ad conver sion. once ad conversion has started, the ad conversion busy flag (admod0) is set to 1, indicating that ad conversion is currently in progress. (4) ad conversion mode and ad conversion end interrupt the following four ad conversion modes are supported: ? channel-fixed single conversion mode ? channel-scanned single conversion mode ? channel-fixed repetitive conversion mode ? channel-scanned repetitive conversion mode the ad conversion mode is selected using ad mode control register 0, admod0. upon the completion of ad conversion, an ad conversion end interrupt, intad is issued. the admod0 bit, which indicates the end of ad conversion, is also set to 1. a. channel-fixed single conversion mode setting admod0 to 00 selects channel-fixed single conversion mode. in this mode, the ad converter performs conversion only once for the selected single channel. upon the completion of conversion, admod0 is set to 1, admod0 is cleared to 0, and an intad interrupt request is issued. b. channel-scanned single conversion mode setting admod0 to 01 selects channel-scanned single conversion mode. in this mode, the ad converter perfor ms conversion once for each of the selected scan channels. upon the completion of conversion for all selected channels, admod0 is set to 1, admod0 is cleared to 0, and an intad interrupt request is issued. c. channel-fixed repetitive conversion mode setting admod0 to 10 selects channel-fixed repetitive conversion mode. in this mode, the ad converter repeatedly performs conversion for the selected single channel. upon the completion of conversion, admod0 is set to 1. admod0 is not, however, cleared to 0 and maintains the state of 1. the intad interrupt request timing can be selected using the setting of admod0. setting to 0 causes an interrupt request to be issued upon the completion of every single ad conversi on. setting to 1 causes an interrupt request to be issued upon the completion of every four ad conversions.
tmp92cd54i 2009-12-26 92cd54i-271 tentative d. channel-scanned repeti tive conversion mode setting admod0 to 11 selects channel-scanned repetitive conversion mode. in this mode, the ad converter repeatedly performs conversion for the selected scan channels. upon the completion of a single conversion, admod0 is set to 1 and an intad interrupt request is issued. admod0 is not cleared to 0 and maintains the state of 1. to stop operation in a repetitive conversion mode (c or d), write a 0 to admod0. once the conversion currently being executed is completed, the repetitive conversion mode terminates and admod0 is cleared to 0. when admod1 is cleared to zero , causing a transition to halt mode, the ad converter immediately stops operation even if ad conversion is still in progress. when the ad converter exits from a halt, it starts ad conversion from the beginning if it operates in a repetitive conversion mode (c or d). in a single conversion mode (a or b), it does not restart conversion (remains stopped). table 3.13.2 shows the relationship between the ad conversion mode and the occurrence of an interrupt request. table 3.13.2 relationship between ad conversion modes and interrupt requests admod0 mode interrupt request generation channel fixed single conversion mode after completion of conversion x 0 0 channel scan single conversion mode after completion of scan conversion x 0 1 every conversion 0 channel fixed repeat conversion mode every forth conversion 1 1 0 channel scan repeat conversion mode after completion of every scan conversion x 1 1 x: don?t care
tmp92cd54i 2009-12-26 92cd54i-272 tentative (5) ad conversion time an ad conversion for a single channel requires 160 states (8 s when f c = 20 mhz). (6) storing and reading the results of ad conversion the results of ad conversion are stored in the ad conversion result upper/lower registers (adreg0h/l to adre gbh/l), which are read-only. in channel-fixed repetitive conversion mode, the results of ad conversion are stored sequentially in adreg0h/l through adreg3h/l. in other modes, the results of conversion for channels an0 to an11 are stored in adreg0h/l to adregbh/l, respectively. table 3.13.3 shows the correspondence betw een the analog input channels and the ad conversion result registers. table 3.13.3 correspondence between analog input channels and ad conversion result registers ad conversion result register a nalog input channel (portg/portl) conversion modes other than at right channel fixed repeat conversion mode (every 4 th conversion) an0 adreg0h/l an1 adreg1h/l an2 adreg2h/l an3 adreg3h/l an4 adreg4h/l an5 adreg5h/l an6 adreg6h/l an7 adreg7h/l an8 adreg8h/l an9 adreg9h/l an10 adregah/l an11 adregbh/l a dreg0h/l a dreg1h/l a dreg2h/l a dreg3h/l the ad conversion result storage flag, adregxl, is bit 0 in the ad conversion result lower register and indicates whether the corresponding ad conversion result registers have been read. this flag is set to 1 when a converted value is stored into the ad conversion result registers and cleared to 0 when either of the ad conversion result registers (a dregxh or adregxl) is read. reading the results of ad conversion causes the ad conversion end flag, admod0, to be cleared to 0.
tmp92cd54i 2009-12-26 92cd54i-273 tentative example settings: a. when performing ad conversion for analog input voltage on the an3 pin and using the ad interrupt (intad) handling routine to write the converted value to memory address 0800h settings in main routine 7 6 5 4 3 2 1 0 inte0ad 1 1 0 0 - - - - enable intad and set the interrupt level to 4. admod1 1 1 0 0 0 0 1 1 set the analog input channel to an3. admod0 x x 0 0 0 0 0 1 start conversion in channel-fixed single conversion mode. example processing in interrupt routine wa adreg3 read the values of adreg3l and adreg3h into general register wa (16 bits). wa > > 6 shift the contents of wa six times to the right and pad the uppe r bits with 0s. (0800h) wa write the contents of wa to address 0800h. b. when continuously performing ad conversion for analog input voltages on three pins, an0 to an2, in channel-scanned repetitive conversion mode inte0ad 1 0 0 0 - - - - disable intad. admod1 1 1 0 0 0 0 1 0 set the analog input channels to an0-an2. admod0 x x 0 0 0 1 1 1 start conversion in channel -scanned repetitive conversion mode. x = don't care "-" = no change
tmp92cd54i 2009-12-26 92cd54i-274 tentative 3.14 watchdog timer (runaway detection timer) the tmp92cd54i contains a watchdog timer for runaway detection. the watchdog timer (wdt) is designed to detect any malfunction (runaway) of the cpu due to noise or for other reasons and help the cpu recover its normal operating status. if the watchdog timer detects a runaway, it issues a nonmaskable intwd interrupt to notify the cpu. this watchdog timer output can also be connected to the reset input (within the chip) to forcibly apply a reset. 3.14.1 configuration figure 3.14.1 shows a block diagram of the watchdog timer. internal reset wdmod reset wdt control register wdcr binary counter (22 stage) internal reset wdmod intwd interrupt (2 / fc) selector 2 16 /fc wdmod internal data bus write b1h reset reset control 2 18 /fc 2 20 /fc 2 22 /fc write 4eh halt instruction executing (stop, idle3 or idle1 mode ) q r s figure 3.14.1 block diagram of watchdog timer
tmp92cd54i 2009-12-26 92cd54i-275 tentative the watchdog timer consists of a 22-stage binary counter that uses (2/fc) as an input clock. the binary counter outputs 2 16 /fc, 2 18 /fc, 2 20 /fc, and 2 22 /fc. with one of those outputs selected using wdmod, a watchdog timer interrupt occurs if an overflow occurs for that output, as shown in figure 3.14.2. to continue using the watchdog timer after an intwd request is issued, write a clea r code (4eh) to the wd cr register to clear the binary counter. 0 wdt interrupt wdt clea r (soft ware) write clear code wdt counter n over flow figure 3.14.2 normal mode the result of runaway detection can also be internally connected to the reset pin. in that case, a reset is applied for a period of between 44 4/fc and 58 4/fc system clock cycles (8.8 to 11.6 s when f c = 20 mhz), as shown in figure 3.14.3. over flow wdt counter n wdt interrupt 44 4/fc to 58 4/fc system clocks (8.8 to 11.6 s @ f c = 20 mhz) internal reset figure 3.14.3 reset mode
tmp92cd54i 2009-12-26 92cd54i-276 tentative 3.14.2 control registers the watchdog timer (wdt) is controlled usin g three control registers: wdmod, wdcr, and clkmod. (1) watchdog timer mode register (wdmod) a. setting the watchdog time r detection time this 2-bit register spec ifies a watchdog timer interrupt time for runaway detection. upon a reset, the wdmod bits are initialized to 00 so that the detection time is 2 16 /fc [s] (approximately 65,53 6 system clock cycles). b. enabling/disabling the watchdog timer upon a reset, wdmod is initialized to 1 so that the watchdog timer is enabled. disabling the watchdog timer requires writing a disable code (b1h) to the wdcr register in addition to clearing this bit to 0. this dual configuration makes it difficult for the watchdog timer to be disabled due to a runaway. enabling the disabled watchdog timer re quires only setting the bit to 1. c. connecting the watchdog timer output to a reset this register specifies whet her the watchdog timer resets itself when it detects a runaway. upon a reset, wdmod is initialized to 0 so that the watchdog timer output is not used to reset itself. (2) watchdog timer control register (wdcr) this register controls disabling the watchd og timer and clearing the binary counter. ? controlling disable after clearing wdmod to 0, writing a disable code (b1h) to the wdcr register disables the watchdog timer. wdmod 0 - - - - - - - clear wdte to 0. wdcr 1 0 1 1 0 0 0 1 write disable code (b1h). ? controlling enable set wdmod to 1. ? controlling watchdog timer clear writing a clear code (4eh) to the wdcr re gister causes the binary counter to be cleared and restart counting. to contin ue using the watchdog timer after an intwd interrupt is issued, write a clear co de to the wdcr register to clear the binary counter. wdcr 0 1 0 0 1 1 1 0 write clear code (4eh). (3) clock mode register (clkmod) this register controls the output signal on the clk pin. writing a 0 to the clkmod bit causes the clk pin output to be stopped. the output on the clk pin can be selected from one of fc and 2/5 fc by setting clkmod. the clkmod bits specify the halt mode as idle2, idle1, idle3, or stop.
tmp92cd54i 2009-12-26 92cd54i-277 tentative 7 6 5 4 3 2 1 0 bit symbol wdte wdtp1 wdtp0 - drve i2wdt rescr - read/write r/w r/w after reset 1 0 0 - 0 0 0 0 function wdt control 0: disable 1: enable select detecting time 00: 2 16 /f c 01: 2 18 /f c 10: 2 20 /f c 11: 2 22 /f c 1: drives pins in stop mode idle2 0: stop 1: operate 1: internally connects wdt out to the reset pin always write 0 watchdog timer out control 0- 1 connects wdt out to a reset idle2 control 0 stop 1 operation watchdog timer detection time 00 2 16 /f c (approximately 3.28ms @ fc = 20mhz) 01 2 18 /f c (approximately 13.1ms @ fc = 20mhz) 10 2 20 /f c (approximately 52.4ms @ fc = 20mhz) 11 2 22 /f c (approximately 210ms @ fc = 20mhz) watchdog timer enable/disable control 0 disabled 1 enabled figure 3.14.4 watchdog timer mode register 7 6 5 4 3 2 1 0 bit symbol ? read/write w after reset ? function b1h: wdt disable code 4eh: wdt clear code wdt disable/clear control b1h disable code 4eh clear code others don?t care figure 3.14.5 watchdog timer control register wdcr ( 0111h ) wdmod ( 0110h )
tmp92cd54i 2009-12-26 92cd54i-278 tentative 7 6 5 4 3 2 1 0 bit symbol haltm1 haltm0 - - - clkoe clkm1 clkm0 read/write r/w r/w r/w after reset 1 1 - 0 - 0 0 0 function halt mode 00: idle3 01: stop 10: idle1 11: idle2 fixed to ?0? clkoutput enable 0: not output 1: output clk output select 00: fc 01: reserved 10: 2/5 fc 11: reserved clk output clock select 00 fc 01 reserved 10 2/5 fc 11 reserved clk output enable 0 no output (high-z, pulled up) 1 output selects standby mode by halt instruction 00 idle3 01 stop 10 idle1 11 idle2 figure 3.14.6 clock mode register clkmod ( 010ah )
tmp92cd54i 2009-12-26 92cd54i-279 tentative 3.14.3 description of operation the watchdog timer issues an intwd interrupt when the detection time specified with the wdmod bits has elapsed. the software (instruction) should clear the binary counter for the watchdog timer to 0 befo re an intwd interrupt occurs. if the cpu is malfunctioning due to noise or for other reasons (runaway), it fails to execute an instruction for clearing the binary counter, which will overflow and cause an intwd interrupt to occur. once an intwd interrupt occurs, indicating that the cpu is malfunctioning (runaway), the runaway handling program can restore it to normal condition. the watchdog timer starts operation i mmediately after a reset is released. in idle1, idle3, or stop mode, the watchdog timer is reset and stopped. in idle2 mode, its state depends on the setting of wdmod. set wdmod, as required, before entering idle2 mode. example: a. clear the binary counter. a. clear the binary counter. wdcr 0 1 0 0 1 1 1 0 write clear code (4eh). b. set the watchdog timer detection time to 2 18 /fc. wdmod 1 0 1 - - - - - c. disable the watchdog timer. wdmod 0 - - x - - - - clear to 0. wdcr 1 0 1 1 0 0 0 1 write disable code (b1h).
tmp92cd54i 2009-12-26 92cd54i-280 tentative 3.15 ram controller the ram controller enables/disables writes to the built-in ram and detects a low supply voltage to dvcc3. dvcc3 is a voltage supplied to the built-in ram and internal logic. if dvcc3 falls below the vstb level, the built-in ram may not be able to maintain data. the ramcr flag, which detects a low voltage, is always written with a 1. a write of 0 to this flag is invalid. the flag is cleared to 0 if dvcc3 falls below the vstb level (including a power-on reset). it is not cleared by a transition to halt mode or a warm reset. this flag can be read to determine a reset status (warm reset or power-on reset) and ram data status (maintained or lost). the flag retu rns a 1 for a warm reset and a 0 for a power-on reset. it returns a 1 when ram data is maintained and a 0 if it may be lost. the bit controls data writes to the built-in ram. upon a reset, is set to 1 so that writes to the built-in ram are enabled. clearing to 0 disables writes to the built-in ram. 7 6 5 4 3 2 1 0 bit symbol ramstb ramwi - - - - - - read/write r/w after reset 0 *note1 1 - - - - - - ramcr (016dh) function 0:lost data or power on reset 1:kept data internal ram write 0:inhibit 1:accept write control to internal ram 0 inhibit to write to internal ram 1 accept to write to internal ram 0 after ?1? is set by software, this bit is reset to ?0? at dvcc3 vstb. after power on reset. 1 after ?1? is set by software, this data isn?t changed at dvcc3 > vstb. note 1: it is initialized to 0 upon a power-on reset but not affected by a warm reset. the software should first write a 1 to the flag before usi ng it. a write of 0 to this flag is invalid. note 2: if the device enters a halt mode (stop /idle3) with set to 1, current consumption is not sufficiently reduced due to a current that flows through resistance within the voltage detection circuit. in a system for which low power dissipation is required, the voltage detection circuit can be disabl ed to suppress current consumption. note 3: a period of eight states is required between a 1 being written to and the voltage detection circuit starting operation (w hen fc = 20 mhz). do not execute the halt instruction during a warm-up period of the voltage detection circuit. note 4: the emulator does not support the ram controller function. figure 3.15.1 ram control register ram standby flag
tmp92cd54i 2009-12-26 92cd54i-281 tentative 3.16 real-time clock (rtc) the tmp92cd54i contains a real-time clock, which is dedicated to measuring a specified time. the real-time clock issues intrtc interrupts at regular intervals. the interrupt interval can be selected from among 0.0625 s, 0.125 s, 0.25 s, 0.50 s, 1 s, and 2 s (when fs = 32.768 khz ). the tmp92cd54i supports a low current consumption mode in which only the real-time clock operates, called idle3 mode. it also operates in idle1 and idle2 modes and can release each hold mode upon the occurrence of an intrtc interrupt request. 3.16.1 block diagram figure 3.16.1 block diagram fo r timer for real-time clock 3.16.2 registers two registers are provided to control the real-time clock and low-speed oscillator. the real-time clock control register, rtccr, controls the real-time clock. the rtccr bits specify one of six intervals for intrtc interrupt requests. the real-time clock function register, rtcfc, controls the low-speed oscillator. either a crystal or cr oscillator can be used for the low-speed oscillator. set rtcfc according to the oscillator to be used. the rtcfc register is initialized when the device recovers from stop mode with an interrupt. it is, therefore, necessary to re-set rtcfc after a halt release. (the rtcfc register is not initialized upon a recovery from idle3, idle1, or idle2 mode.) figure 3.16.2 and figure 3.16.3 show register tables. 14-stage binary counter 2 11 2 12 2 13 2 14 2 15 2 16 intrtc interrupt rtccr rtccr run /clear selector fs (32.768 khz) xt2 xt1 low frequency osc rtcfc rtcfc
tmp92cd54i 2009-12-26 92cd54i-282 tentative timer for real time clock control register 7 6 5 4 3 2 1 0 bit symbol - - - - rtcsel2 rtcsel1 rtcsel0 rtcrun read/write r/w r/w r/w after reset 0 - - - 0 0 0 0 function write 0 1x0:2 16 /fs (2s) 1x1:2 15 /fs (1s) x:don?t care 000:2 14 /fs(0.50s) 001:2 13 /fs(0.25s) 010:2 12 /fs(0.125s) 011:2 11 /fs(0.0625s) 0: stop& clear 1: run 0 stop & clear 1 count 000 0.50s 001 0.25s 010 0.125s 011 0.0625s 1x0 2s 1x1 1s figure 3.16.2 timer for real time clock control register timer for real time clock function register 7 6 5 4 3 2 1 0 bit symbol xtsel - - - - - - xten read/write r/w r/w after reset 0 - - - - - - 0 function type of low frequency oscillator(fs) 0: crystal 1: cr low frequency oscillator (fs) 0:stop 1:oscillation 0 stop 1 oscillation note 1: setting rtcfc to 1 causes the low-speed oscillator to start oscillation but it requires a wait time until oscilla tion is stabilized. for the value of tsta for a crystal resonator, contact the manufacturer of the resonator. note 2: this register is initialized when the devic e recovers from stop mode with an interrupt. it is, therefore, necessary to re-set the register after a halt release. (it is not initialized upon a recovery from idle3, idle1, or idle2 mode.) figure 3.16.3 timer for real time clock function register rtccr (118h) counting operation interrupt generation cycle (fs = 32.768 khz) rtcfc (119h) low frequency oscillator (fs=32.768 khz)
tmp92cd54i 2009-12-26 92cd54i-283 tentative example of register setting: ld (rtcfc), 01h ; start low-speed oscillation. : ; oscillator stabilization time ld (rtccr), 03h ; intrtc interrupt occurs every 2 13 /fs. 3.16.3 cr oscillation either a crystal or cr oscillator can be used for the low-speed oscillator. set rtcfc according to the oscillator to be used. when using cr oscillation, connect a resistor and capacitor to the xt1 and xt2 pins. figure 3.16.4 shows a recommend ed cr oscillation circuit. example constants for 32.768 khz: r = 40 k ? , c = 470 pf r = 82 k ? , c = 220 pf note: the above combination of constants has been tested under room temperature conditions. the values should be adjusted according to the end product considering the characteristics of the capacitor and resistor. figure 3.16.4 a external c ircuit for cr oscillation xt2 xt1 low frequency osc r c tmp92cd54i
tmp92cd54i 2009-12-26 92cd54i-284 tentative 3.17 power regulator the tmp92cd54i contains a 3-v output regu lator for internal lo gic power supplies. connecting each dvcc3 pin to the regulator ou tput pin, regout, enables the regulator to supply power to internal logic circuits. table 3.17.1 regout output by regen setting regen input regout output ?h? 3v output for internal logic ?open? note) 3v output for internal logic note 1: the regen pin has a pull-up resistor c onnected internally and thus can be left open. it is recommended to leave it open to ensure a rise time for the regen signal. 3.17.1 block diagram figure 3.17.1 regulator block 3.17.2 external connection to prevent the output voltage from oscillating, connect a stabilizing capacitor (cs) to a point between regout and dvss as close to them possible. depending on the board capacitance, a resistor in seri es with cs (esr) may also be necessary, as shown in figure 3.17.2. it is recommended to use a capacitor having good temperature characteristics because variations in internal resistance with temp erature may cause the regulator output to be unstable. a bypass capacitor (cb) between dvcc3 and dvss is also recommended to improve noise immunity of the regout output. pass tr bgr regout feedback loop dvcc5 regen dvss
tmp92cd54i 2009-12-26 92cd54i-285 tentative figure 3.17.2 regulator connection 3.17.3 handling precautions 1. application this regulator is designed for the tmp92cd54i. the output from regout must not be connected to anywhere other than the dvcc3 pin on the tmp92cd54i. 2. power-on and regen input signal timing when the device is powered on, the regen pin should be left open or an enable signal (high level) should be input to the pin at least 1 s after the power-on. 3. constant settings (cin, cs, cb, esr) the characteristics of stray capacitance or parasitic capacitance according to the module configuration may affect the regulato r characteristics. when using the device, investigate static and transient characteristics based on the actual operating conditions to set constants with sufficient margins. tmp92cd54i cin regen regout dvcc5 dvss dvcc3 cs esr cb open
tmp92cd54i 2009-12-26 92cd54i-286 tentative 4. electrical characteristics 4.1 absolute maximum ratings the absolute maximum ratings of a semiconductor device are a set of ratings that must not be exceeded, even for a moment. do not exceed any of these ratings. exceeding the rating(s) may cause the device breakdown, damage or deterioration, and may result injury by explosion or combustion. the equipment manufacturer should design so that no maximum rating value is exceeded. parameter symbol rating unit power supply voltage v cc5 ? 0.5 to 6.0 v input voltage v in ? 0.5 to vcc5 + 0.5 v output current (total) i ol 100 ma output current (total) i oh ? 100 ma power dissipation (ta=85 c) p d 600 mw soldering temperature (10s) t solder 260 c storage temperature t stg ? 65 to 150 c operation temperature t opr ? 40 to 85 c solderability te s t parameter test condition note (1) use of sn-37pb solder bath solder bath temperature = 230 c, dipping time = 5 seconds the number of times = one, use of r-type flux solderability (2) use of sn-3.0ag-0.5cu solder bath solder bath temperature = 245 c, dipping time = 5 seconds the number of times = one, use of r-type flux pass: solderability rate until forming 95%
tmp92cd54i 2009-12-26 92cd54i-287 tentative 4.2 dc electrical characteristics v cc5 = 4.5v to 5.25v / fc = 16 to 20mhz / ta = ? 40 to 85 c parameter symbol condition min max unit supply voltage v cc5 4.5 5.25 v input low voltage p00 to p07(d0 to 7) pg0 to pg7 pl0 to pl3 v il0 ? 0.3 0.8 v input low voltage p00 to p07(port) p40 to p47 v il1 ? 0.3 0.3 v cc5 v input low voltage int0 nmi reset p70, p71, p73 to p75 pc0 to pc5 pd0 to pd7 pf0 to pf7 pm0 to pm4 v il2 ? 0.3 0.25 v cc5 v p72, pn0 to pn6 v il6 ? 0.3 0.3 v cc5 v input low voltage am0 to am1 test0 to test1 v il3 ? 0.3 0.3 v input low voltage x1, xt1 (crystal) v il4 vcc3 = 3.3v ? 0.3 0.2 vcc3 v input low voltage xt1 (cr) v il5 vcc3 = 3.3v ? 0.3 0.2 vcc3 v input high voltage p00 to p07(d0 to 7) pg0 to pg7 pl0 to pl3 v ih0 2.2 v cc5 + 0.3 v input high voltage p00 to p07 p40 to p47 v ih1 0.7 v cc5 v cc5 + 0.3 v input high voltage int0 nmi reset p70, p71, p73 to p75 pc0 to pc5 pd0 to pd7 pf0 to pf7 pm0 to pm4 v ih2 0.75 v cc5 v cc5 + 0.3 v p72, pn0 to pn6 v ih6 0.7 v cc5 v cc5 + 0.3 v input high voltage am0 to am1 test0 to test1 v ih3 v cc5 ? 0.3 v cc5 + 0.3 v input high voltage x1, xt1 (crystal) v ih4 vcc3 = 3.3v 0.8 vcc3 vcc3+0.3 v input high voltage xt1 (cr) v ih5 vcc3 = 3.3v 0.7 vcc3 vcc3+0.3 v
tmp92cd54i 2009-12-26 92cd54i-288 tentative v cc5 = 4.5v to 5.25v / fc = 16 to 20mhz / ta = ? 40 to 85 c parameter symbol condition min max unit output low voltage v ol i ol = 3.0 ma 0.4 v v oh0 i oh = ? 400 a 2.4 v oh1 i oh = ? 100 a 0.75 v cc5 v oh2 i oh = ? 20 a 0.9 v cc5 output high voltage v ohn i oh = ? 200 a, pf6(tx) pin only 0.82 v cc5 v input leakage current i li 0.0 vin v cc5 , vin: input voltage 0.02 (typ.) 5 a output leakage current i lo 0.2 vin v cc5 ? 0.2, vin: input voltage 0.05 (typ.) 10 a operating current (single chip) (note1) i cc5 v cc5 =5.25v , x1=10mhz(internal 20mhz) 70 (typ) 100 ma i cc5idle2 idle2 mode v cc5 =5.25v, x1=10mhz (internal 20mhz) 90 i cc5idle1 idle1 mode v cc5 =5.25v, x1=10mhz (internal 20mhz) 30 ma i cc5idle3 idle3 mode v cc5 =5.25v, ta = ? 40 to 85 c v cc5 =5.25v, ta = ? 10 to 55 c 220 140 a operating current (stand-by) (note2) i cc5stop stop mode v cc5 =5.25v, ta = ? 40 to 85 c v cc5 =5.25v, ta = ? 10 to 55 c 200 120 a stand-by voltage v stb5 v cc3 < v cc5 , v ih1 < v cc5 , v ih2 < v cc5 , v ih3 < v cc5 3.0 5.25 v r rst reset r clk clk pull-up resistor r regen regen 60 220 k ? schmitt width v th int0, nmi , reset , p70 to p75, pc0 to pc5, pd0 to pd7, pf0 to pf7, pm0 to pm4, pn0 to pn6 0.4 1.0 (typ.) v note 1: value when the external bus is not operating. note 2: i cc5idle3 and i cc5stop are values when the voltage detection circuit for the ram controller is not operating. (ramcr = 0)
tmp92cd54i 2009-12-26 92cd54i-289 tentative 4.3 ac electrical characteristics v cc5 = 4.5 to 5.25 v / fc = 16 to 20 mhz / ta = ? 40 to 85 c no. parameter symbol min max 20mhz 16mhz unit 1 oscillator frequency (x1/x2) t osc 100 125 100 125 ns 2 system clock cycle period (= t) t cyc 50 62.5 50 62.5 ns 3 clk pulse width low t cl 0.5 t ? 15 10 16 ns 4 clk pulse width high t ch 0.5 t ? 15 10 16 ns 5-1 a0-a23 transition to d0-d7 data in at 0 wait state t ad 2.0 t ? 50 50 75 ns 5-2 a0-a23 transition to d0-d7 data in at 1 wait state t ad3 3.0 t ? 50 100 138 ns 6-1 rd asserted to d0-d7 data in at 0 wait state t rd 1.5 t ? 45 30 49 ns 6-2 rd asserted to d0-d7 data in at 1 wait state t rd3 2.5 t ? 45 80 111 ns 7-1 rd pulse width low at 0 wait state t rr 1.5 t ? 20 55 74 ns 7-2 rd pulse width low at 1 wait state t rr3 2.5 t ? 20 105 136 ns 8 a0-a23 valid to rd asserted t ar 0.5 t ? 20 5 11 ns 9 rd asserted to clk low t rk 0.5 t ? 20 5 11 ns 10 a0-a23 transition to d0-d7 hold t ha 0 0 0 ns 11 rd negated to d0-d7 hold t hr 0 0 0 ns 12 wait setup time t tk 15 15 15 ns 13 wait hold time t kt 5 5 5 ns v cc5 = 4.5 to 5.25 v / fc = 16 to 20 mhz / ta = ? 40 to 85 c no. parameter symbol min max 20mhz 16mhz unit 1 oscillator frequency (x1/x2) t osc 100 125 100 125 ns 2 system clock cycle period t cyc 50 62.5 50 62.5 ns 3 clk pulse width low t cl 0.5 t ? 15 10 16 ns 4 clk pulse width high t ch 0.5 t ? 15 10 16 ns 5-1 d0-d7 valid to wr negated at 0 wait state t dw 1.25 t ? 35 28 43 ns 5-2 d0-d7 valid to wr negated at 1 wait state t dw3 2.25 t ? 35 78 106 ns 6-1 wr pulse width low at 0 wait state t ww 1.25 t ? 30 33 48 ns 6-2 wr pulse width low at 1 wait state t ww3 2.25 t ? 30 83 111 ns 7 a0-a23 transition to wr asserted t aw 0.5 t ? 20 5 11 ns 8 wr asserted to clk low t wk 0.5 t ? 20 5 11 ns 9 wr negated to a0-a23 hold t wa 0.25 t ? 5 8 11 ns 10 wr negated to d0-d7 hold t wd 0.25 t ? 5 8 11 ns 11 wait setup time t tk 15 15 15 ns 12 wait hold time t kt 5 5 5 ns 13 rd negated to d0-d7 out t rdo 1.25 t ? 35 20 26 ns ac test conditions: output conditions of the d0 to d7, a0 to a7, a8 to a15, a16 to a23, rd and wr pins: high = 2.0 v, low = 0.8 v, cl = 50 pf output conditions of pins other than the above-mentioned ones: high = 2.0 v, low = 0.8 v, cl = 50 pf input conditions of the p00 to p07 (d0 ? d7) pins: high = 2.4 v, low = 0.45 v, cl = 50 pf input conditions of pins other than the above-mentioned ones: high = 0.8 v cc5 , low = 0.2 v cc5 , cl = 50 pf read cycle write cycle
tmp92cd54i 2009-12-26 92cd54i-290 tentative (1) read cycle timing (0 wait state) note: the signals other than the x1 signal are derived from the x1 signal. thus, certain timing delays occur in the generation of these signals. since these delay times vary depending on each sample device, the phase differences between the x1 si gnal and the other signals cannot be specified. the phase relationship shown in the above timing diagram is only an example. t ar t ha t osc t cl t ch t cyc t tk t kt t ad t hr t rk x1 input clk output (when clk = fc) wait a0-a23 outputs cs output rd output data in t rd t rr d0-d7 inputs
tmp92cd54i 2009-12-26 92cd54i-291 tentative (2) write cycle timing (0 wait state) note: the signals other than the x1 signal are derived from the x1 signal. thus, certain timing delays occur in the generation of these signals. since these delay times vary depending on each sample device, the phase differences between the x1 si gnal and the other signals cannot be specified. the phase relationship shown in the above timing diagram is only an example. t osc t cl t ch t cy c t tk t k t x1 input clk output (when clk = fc) wait input a0-a23 outputs cs output t wd t dw data out t ww t aw t wk t w a wr output rd output t rdo d0-d7 outputs
tmp92cd54i 2009-12-26 92cd54i-292 tentative (3) read cycle timing (1 wait state) (4) write cycle timing (1 wait state) clk output (when clk=fc) wait input a 0-a23 outputs cs output (when clk=fc) rd output wr output d0-d7 outputs t dw3 data out t rd o t tk t k t t tk t k t t ww3 t r r 3 t ad3 clk output (when clk=fc) wait input a 0-a23 outputs cs output rd output d0-d7 inputs t rd3 data in t tk t k t t tk t k t
tmp92cd54i 2009-12-26 92cd54i-293 tentative 4.4 ad converter characteristics v cc5 = 4.5v to 5.25v / fc = 16 to 20mhz / ta = ? 40 to 85 c parameter symbol min typ. max unit analog reference voltage ( + ) v refh v cc5 ? 0.2 v cc5 v cc5 analog reference voltage ( ? ) v refl gnd gnd gnd supply voltage for ad converter av cc v cc5 ? 0.2 v cc5 v cc5 ground for ad converter av ss gnd gnd gnd analog input voltage av in v refl v refh v supply current for analog reference voltage = 1 0.8 1.2 ma supply current for analog reference voltage = 0 i ref 0.02 5 a total error (excluding quantization error) e t 3.0 lsb note: ?lsb? is a unit that represents the resolution of the ad converter. 3 lsb = 3 (v refh - v refl )/1024 15 mv (v refh = 5.0 v, v refl = 0.0 v) 4.5 event counters (ti0, ti 4, ti8, ti9, tia, tib) v cc5 = 4.5v to 5.25v / fc = 16 to 20mhz / ta = ? 40 to 85 c variable 20mhz 16mhz parameter symbol min max min max min max unit clock cycle period t vck 8t + 100 500 600 ns clock pulse width low t vckl 4t + 40 240 290 ns clock pulse width high t vckh 4t + 40 240 290 ns 4.6 serial channel timing (1) sclk input mode (i/o interface mode) v cc5 = 4.5 v to 5.25 v / fc = 16 to 20 mhz / ta = ? 40 to 85 c variable 20mhz 16mhz parameter symbol min max min max min max unit sclk cycle t scy 16t 0.8 1.0 s output data sclk rise t oss t scy /2 ? 4t ? 110 90 140 sclk rise output data hold t ohs t scy /2 + 2t 500 625 sclk rise input data hold t hsr 3t+10 160 197 sclk rise input data valid t srd t scy 800 1000 ns (2) sclk output mode (i/o interface mode) v cc5 = 4.5 v to 5.25 v / fc = 16 to 20 mhz / ta = ? 40 to 85 c variable 20mhz 16mhz parameter symbol min max min max min max unit sclk cycle (programmable) t scy 16t 8192t 0.8 409.6 1.0 512 s output data sclk rise t oss t scy / 2 ? 40 360 460 sclk rise output data hold t ohs t scy / 2 ? 40 360 460 sclk rise input data hold t hsr 0 0 0 sclk rise input data valid t srd t scy ? t ? 180 570 758 ns
tmp92cd54i 2009-12-26 92cd54i-294 tentative (3) sclk input mode (uart mode) v cc5 = 4.5 v to 5.25 v / fc = 16 to 20 mhz / ta = ? 40 to 85 c variable 20mhz 16mhz parameter symbol min max min max min max unit sclk cycle t scy 4t + 20 220 270 sclk low level pulse width t scyl 2t + 5 105 130 sclk high level pulse width t scyh 2t + 5 105 130 ns 4.7 interrupt operation v cc5 = 4.5 v to 5.25 v / fc = 16 to 20 mhz / ta = ? 40 to 85 c variable 20mhz 16mhz parameter symbol min max min max min max unit nmi , int0 low width t intal 4t 200 250 nmi , int0 high width t intah 4t 200 250 wuint0 to wuint7, int1 to int7 low width t intbl 8t + 100 500 600 wuint0 to wuint7, int1 to int7 high width t intbh 8t + 100 500 600 ns sclk output data txd t hsr valid valid t srd 1 0 t ohs t scy t oss input data rxd
tmp92cd54i 2009-12-26 92cd54i-295 tentative 4.8 serial bus interface v cc5 = 4.5 v to 5.25 v / fc = 16 to 20 mhz / ta = ? 40 to 85 c fc = 20 mhz 400 khz =1000 100 khz =1111 (note 2) =0011 to 0110 parameter symbol min max min max min max unit scl clock frequency f scl 0 400 0 100 0 fc/(2 n + 8) khz hold time (repeated) start condition. after this period, the first clock pulse is generated. t hd:sta 650 4500 2 n ? 1 /fc low period of the scl clock t low 1300 4700 2 n ? 1 /fc high period of the scl clock t high 600 4000 (2 n ? 1 + 8)/fc set-up time for a repeated start condition t su:sta by software by software by software data hold time t hd:dat 0 900 0 3450 0 6/fc data set-up time t su:dat 100 250 (2 n ? 1 ? 6)/fc data set-up time (the case in the first bit after transfer ) t su:1stdat 100 250 (2 n ? 1 ? 12)/fc rise time of both sda and scl signals (note 1) t r 300 (receive) 1000 (receive) ? fall time of both sda and scl signals t f 300 300 ? set-up time for stop condition t su:sto 950 4200 (2 n ? 1 + 12)/fc bus free time between a stop and start condition t buf by software by software by software ns capacitive load for each bus line c b 400 400 400 pf noise margin at the low level for each connected device (including hysteresis) v nl 0.2 v cc5 0.2 v cc5 0.2 v cc5 v noise margin at the high level for each connected device (including hysteresis) v nh 0.2 v cc5 0.2 v cc5 0.2 v cc5 v pulse width of spikes which must be suppressed by the input filter t sp 0 50 n/a n/a n/a n/a ns note 1: the above values are referred to v ihmin and v ilmax . note 2: the values for = 0011 to 0110 (n = 8 to 11) include the t f f and t r periods. note 3: n/a: not defined s: start p: stop sr: restart sda scl t low t f t hd:sta t hd:dat t r t su:dat t f t high t su:sta t hd:sta t sp t su:sto t r t buf s s r p s t su:1stdat
tmp92cd54i 2009-12-26 92cd54i-296 tentative 4.9 serial expansion interface (sei) v cc5 = 4.5 v to 5.25 v / fc = 16 to 20 mhz / ta = ? 40 to 85 c variable 20mhz symbol parameter min max min max unit t seclk seclk cycle 5t 40t 250 2000 ns t lead ss fall seclk 4t 200 ns t lag seclk ss rise 4t 200 ns t sckh seclk high pulse width t seclk /2-9 116 ns t sckl seclk low pulse width t seclk /2-9 116 ns t su input data set-up t seclk /4-10 52 ns t h input data hold t seclk /4 62 ns t v output data valid t seclk /4 62 ns t ho output data hold 0 0 ns a) sei master (cpha = 0) ss seclk seclk miso mosi b) sei master (cpha = 1) ss seclk seclk miso mosi lsb input bit 6 to 1 msb input lsb output bit 6 to 1 msb output t v t ho t h t su t seclk lsb output bit6 to 1 msb output lsb input bit6 to 1 msb input t v t ho t seclk t sckh t sckl t h t su
tmp92cd54i 2009-12-26 92cd54i-297 tentative c) sei slave (cpha = 0) ss seclk seclk miso mosi d) sei slave (cpha = 1) ss seclk seclk miso mosi 4.10 can controller v cc5 = 4.5 v to 5.25 v / fc = 16 to 20 mhz / ta = ? 40 to 85 c variable 20mhz symbol parameter min max min max unit t cclk can clock period 2t 100 ns t p tx edge rx input 2t cclk -20 180 ns t v t ho t sckl t sckh t lag t lead lsb input bit 6 to 1 msb input lsb output bit 6 to 1 msb output t h t su lsb input bit 6 to 1 msb input lsb output bit 6 to 1 msb output t h t ho t v t su t lead t lag t sckl t sckh t p tx t p rx
tmp92cd54i 2009-12-26 92cd54i-298 tentative 4.11 recommended oscillator circuits the following shows recommended oscillator circuits for the tmp92cd54i. (1) example resonator connections figure 4.11.1 oscillation circuits note: the load capacitance on the oscillator conn ection pins is the sum of c1 and c2 in the oscillator circuit (or in corporated in a resona tor) and stray board capacitance. since the total load capacitance varies with the board layout, the resonator might fail to work properly. to prevent this problem, the board traces near the oscillator circuit should be as short as possible. it is recommended to evaluate the oscillator using the actual application board. (2) recommended ceramic resonators the tmp92fd54ai high-frequency oscillator circuit has been evaluated by murata manufacturing co., ltd. for details, plea se contact your murata representative. figure 4.11.1 shows the recommended circ uit constants for the ceramic resonator manufactured by murata. table 4.11.1 recommended ceramic resonator fo r the tmp92cd54ai (manufactured by murata)) parameter operating condition oscillation frequency [mhz] resonator part number c1 [pf] (note 1) c2 [pf] (note 1) rf [ ? ] rd [ ? ] voltage [v] temperature [ c] 8.0 smd cstce8m00g15c()-r0 (33) (33) open 330 10.0 smd cstce10m0g15c()-r0 (33) (33) open 330 4.5 to 5.25 ? 40 to 85 note 1: enclosed in parentheses are the built-in load capacitor values. note 2: part numbers and specifications of reso nators manufactured by murata are subject to change without notice. for details, please visit murata?s website at h ttp://www.murata.co.jp. (a) connection with high-frequency oscillator x1 x2 c 2 c 1 rd xt1 xt2 c 2 c 1 rd (b) connection with low-frequency oscillator
tmp92cd54i 2009-12-26 92cd54i-299 tentative 4.12 voltage regulator v cc5 = 4.5 v to 5.25 v / fc = 16 to 20 mhz / ta = ? 40 to 85 c parameter symbol condition min. typ. max. unit input voltage v cc5 include ripple fluctuation voltage defined as vp-p 4.5 5.0 5.25 v ripple frequency 100hz (sine-wave) ? 0 0.75 v ripple frequency > 100hz (sine-wave) ? 0 0.3 v peak-to-peak voltage (ripple fluctuation voltage) note) vp-p all ripple frequency (except for sine-wave) ? 0 0.2 v output voltage regout 4.5 vin 5.25, iload = 100ma (vin = v cc5 ) ta = ? 40 to 85 c 3.0 3.3 3.6 v output current iro vin ? regout = 1.0 v ta = ? 40 to 85 c 0 ? 150 ma iq iload 10 a, ta = ? 40 to 85 c ? ? 100 a iq1 10 a < iload < 100ma, ta = 25 c ? ? 800 a quiescent current iop iload = 150ma, ta = ? 40 to 85 c ? ? 10 ma standby current is regen = 0 (regulator only) ? 0.1 0.2 a 0.5[ ? ] esr 5.0[ ? ] parameter symbol condition min. typ. max. unit stabilization capacitor cs cb = 10 f, esr = 4.7 ? 0.1 ? 10 f bypass capacitor cb cs = 10 f, esr = 4.7 ? (cs cb) 0.1 ? 10 f input capacitor cin (note) cs = 10 f, esr = 4.7 ? 4.7 ? 22 f equivalent series resistor esr cs = 10 f, cb = 0.1 f 0.5 ? 5 ? 0.5[ ? ] esr 50[? ] parameter symbol condition min. typ. max. unit stabilization capacitor cs cb = 0.6 f, esr = 47 ? 0.1 ? 10 f bypass capacitor cb cs = 10 f, esr = 47 ? (cs cb) 0.6 ? 10 f input capacitor cin (note) cs = 10 f, esr = 47 ? 4.7 ? 22 f equivalent series resistor esr cs = 10 f, cb = 0.6 f 0.5 ? 50 ? 0.5[ ? ] esr 100[? ] parameter symbol condition min. typ. max. unit stabilization capacitor cs cb = 1.0 f, esr = 100 ? 0.1 ? 10 f bypass capacitor cb cs = 10 f, esr = 100 ? (cs cb) 1.0 ? 10 f input capacitor cin (note) cs = 10 f, esr = 100 ? 4.7 ? 22 f equivalent series resistor esr cs = 10 f, cb = 1.0 f 0.5 ? 100 ? note: tantalum capacitors are recommended. tmp92cd54i dvcc5 regout regen dvss dvcc3 open cin cs es r cb
tmp92cd54i 2009-12-26 92cd54i-300 tentative 5. summary of special function registers special function register s (sfrs) are control re gisters for input/output ports and peripheral units. they are allocated to 1024-byte address space from 000000h to 0003ffh. (1) input/output ports (2) 8-bit timers (3) 16-bit timers (4) serial channels (5) serial expansion interface (6) interrupt controller (7) dma controller (8) control registers (9) ad converter (10) memory controller (11) serial bus interface controller (12) can controller (13) rtc controller table format symbol name address 7 6 5 4 3 2 1 0 bit symbol read/write initial value after reset remarks symbol definitions r/w: cpu read and write access allowed r: only cpu read access allowed w: only cpu write access allowed r/s: cpu read access and setting(note) allowed r/c: cpu read access an d clearing(note) allowed rmw-prohibited: read-modify-write not allowed (prohibited instructions: res/set/t set/chg/stcf/andcf/orcf/xorcf/etc.) (reserved): cannot be set note: r/s and r/c bits are set or clear ed when the cpu writes a 1 to them.
tmp92cd54i 2009-12-26 92cd54i-301 tentative table 5.1 i/o register address maps (1) [1] port address name address name address name address name 0000h 1h 2h 3h p0 (reserved) p0cr p0fc 0010h 11h 12h 13h p4 (reserved) p4cr p4fc 0020h 21h 22h 23h (reserved) (reserved) (reserved) (reserved) 0030h 31h 32h 33h pc (reserved) pccr pcfc 4h 5h 6h 7h (reserved) (reserved) (reserved) (reserved) 14h 15h 16h 17h (reserved) 24h 25h 26h 27h (reserved) (reserved) (reserved) (reserved) 34h 35h 36h 37h pd (reserved) pdcr pdfc 8h 9h ah bh (reserved) (reserved) (reserved) (reserved) 18h 19h 1ah 1bh (reserved) (reserved) (reserved) (reserved) 28h 29h 2ah 2bh (reserved) (reserved) (reserved) (reserved) 38h 39h 3ah 3bh (reserved) (reserved) (reserved) (reserved) ch dh eh fh (reserved) (reserved) (reserved) (reserved) 1ch 1dh 1eh 1fh p7 (reserved) p7cr p7fc 2ch 2dh 2eh 2fh (reserved) (reserved) (reserved) (reserved) 3ch 3dh 3eh 3fh pf (reserved) pfcr pffc [2] sei address name address name address name address name 0040h 41h 42h 43h pg (reserved) (reserved) (reserved) 0050h 51h 52h 53h (reserved) (reserved) (reserved) (reserved) 0060h 61h 62h 63h secr0 sesr0 sedr0 (reserved) 0070h 71h 72h 73h (reserved) (reserved) (reserved) (reserved) 44h 45h 46h 47h (reserved) (reserved) (reserved) (reserved) 54h 55h 56h 57h pl (reserved) (reserved) (reserved) 64h 65h 66h 67h (reserved) (reserved) (reserved) (reserved) 74h 75h 76h 77h (reserved) (reserved) (reserved) (reserved) 48h 49h 4ah 4bh (reserved) (reserved) (reserved) (reserved) 58h 59h 5ah 5bh pm pmode pmcr pmfc 68h 69h 6ah 6bh (reserved) (reserved) (reserved) (reserved) 78h 79h 7ah 7bh (reserved) (reserved) (reserved) (reserved) 4ch 4dh 4eh 4fh (reserved) (reserved) (reserved) (reserved) 5ch 5dh 5eh 5fh pn pnode pncr pnfc 6ch 6dh 6eh 6fh (reserved) (reserved) (reserved) (reserved) 7ch 7dh 7eh 7fh (reserved) (reserved) (reserved) (reserved) note: do not access reserved registers.
tmp92cd54i 2009-12-26 92cd54i-302 tentative table 5.2 i/o register address map (2) [3] 8-bit timers: [4] 16-bit timers: address name address name address name address name 0080h 81h 82h 83h trun01 (reserved) treg0 treg1 0090h 91h 92h 93h trun45 (reserved) treg4 treg5 00a0h a1h a2h a3h trun8 (reserved) tmod8 tffcr8 00b0h b1h b2h b3h truna (reserved) tmoda tffcra 84h 85h 86h 87h tmod01 tffcr1 (reserved) (reserved) 94h 95h 96h 97h tmod45 tffcr5 (reserved) (reserved) a4h a5h a6h a7h (reserved) (reserved) (reserved) (reserved) b4h b5h b6h b7h (reserved) (reserved) (reserved) (reserved) 88h 89h 8ah 8bh trun23 (reserved) treg2 treg3 98h 99h 9ah 9bh trun67 (reserved) treg6 treg7 a8h a9h aah abh treg8l treg8h treg9l treg9h b8h b9h bah bbh tregal tregah tregbl tregbh 8ch 8dh 8eh 8fh tmod23 tffcr3 (reserved) (reserved) 9ch 9dh 9eh 9fh tmod67 tffcr7 (reserved) (reserved) ach adh aeh afh cap8l cap8h cap9l cap9h bch bdh beh bfh capal capah capbl capbh [5] sio: [6] intc: address name address name address name address name 00c0h c1h c2h c3h sc0buf sc0cr sc0mod0 br0cr 00d0h d1h d2h d3h inte12 inte34 inte56 inte7 00e0h e1h e2h e3h intesed0 intertc intesb2 intesb0 00f0h f1h f2h f3h inte0ad intetc01 intetc23 intetc45 c4h c5h c6h c7h br0add sc0mod1 (reserved) (reserved) d4h d5h d6h d7h intet01 intet23 intet45 intet67 e4h e5h e6h e7h intesb1 intmk0 intmk1 intmk2 f4h f5h f6h f7h intetc67 (reserved) iimc intnmwdt c8h c9h cah cbh sc1buf sc1cr sc1mod0 br1cr d8h d9h dah dbh intet89 intetab inteto8a intes0 e8h e9h eah ebh intmk3 intmk4 intmk5 (reserved) f8h f9h fah fbh intclr (reserved) (reserved) (reserved) cch cdh ceh cfh br1add sc1mod1 (reserved) (reserved) dch ddh deh dfh intes1 intecrt intecg intesee0 ech edh eeh efh wupflag wupmod wupedge wupmask fch fdh feh ffh (reserved) (reserved) (reserved) (reserved) note: do not access the without allocated names.
tmp92cd54i 2009-12-26 92cd54i-303 tentative table 5.3 i/o register address map (3) [6] intc: [7] wdt: [8] 10-bit adc: address name address name address name address name 0100h 101h 102h 103h dma0v dma1v dma2v dma3v 0110h 111h 112h 113h wdmod wdcr (reserved) (reserved) 0120h 121h 122h 123h adreg0l adreg0h adreg1l adreg1h 0130h 131h 132h 133h adreg8l adreg8h adreg9l adreg9h 104h 105h 106h 107h dma4v dma5v dma6v dma7v 114h 115h 116h 117h (reserved) (reserved) (reserved) (reserved) 124h 125h 126h 127h adreg2l adreg2h adreg3l adreg3h 134h 135h 136h 137h adregal adregah adregbl adregbh 108h 109h 10ah 10bh dmab dmar clkmod (reserved) 118h 119h 11ah 11bh rtccr rtcfc (reserved) (reserved) 128h 129h 12ah 12bh adreg4l adreg4h adreg5l adreg5h 138h 139h 13ah 13bh admod0 admod1 (reserved) (reserved) 10ch 10dh 10eh 10fh (reserved) (reserved) (reserved) (reserved) 11ch 11dh 11eh 11fh (reserved) (reserved) (reserved) (reserved) 12ch 12dh 12eh 12fh adreg6l adreg6h adreg7l adreg7h 13ch 13dh 13eh 13fh (reserved) (reserved) (reserved) (reserved) [9] memc: [10] sbi: address name address name address name address name 0140h 141h 142h 143h (reserved) (reserved) (reserved) (reserved) 0150h 151h 152h 153h (reserved) (reserved) (reserved) (reserved) 0160h 161h 162h 163h (reserved) (reserved) (reserved) (reserved) 0170h 171h 172h 173h sbi0cr1 sbi0dbr i2c0ar sbi0cr2 /sbi0sr 144h 145h 146h 147h (reserved) (reserved) (reserved) (reserved) 154h 155h 156h 157h (reserved) (reserved) (reserved) (reserved) 164h 165h 166h 167h (reserved) (reserved) (reserved) (reserved) 174h 175h 176h 177h sbi0br0 sbi0br1 (reserved) (reserved) 148h 149h 14ah 14bh bcsl bcsh mamr msar 158h 159h 15ah 15bh (reserved) (reserved) (reserved) (reserved) 168h 169h 16ah 16bh (reserved) (reserved) (reserved) fswe (note2) 178h 179h 17ah 17bh sbi1cr1 sbi1dbr i2c1ar sbi1cr2 /sbi1sr 14ch 14dh 14eh 14fh (reserved) (reserved) (reserved) (reserved) 15ch 15dh 15eh 15fh (reserved) (reserved) (reserved) (reserved) 16ch 16dh 16eh 16fh (reserved) ramcr flsr (note2) (reserved) 17ch 17dh 17eh 17fh sbi1br0 sbi1br1 (reserved) (reserved) note: this register is contained only in the tmp92fd54ai. it does not exist in the tmp92cd54i.
tmp92cd54i 2009-12-26 92cd54i-304 tentative table 5.4 i/o register address map (4) [10] sbi: address name address name address name address name 0180h 181h 182h 183h sbi2cr1 sbi2dbr i2c2ar sbi2cr2 /sbi2sr 0190h 191h 192h 193h (reserved) (reserved) (reserved) (reserved) 01a0h 1a1h 1a2h 1a3h (reserved) (reserved) (reserved) (reserved) 01b0h 1b1h 1b2h 1b3h (reserved) (reserved) (reserved) (reserved) 184h 185h 186h 187h sbi2br0 sbi2br1 (reserved) (reserved) 194h 195h 196h 197h (reserved) (reserved) (reserved) (reserved) 1a4h 1a5h 1a6h 1a7h (reserved) (reserved) (reserved) (reserved) 1b4h 1b5h 1b6h 1b7h (reserved) (reserved) (reserved) (reserved) 188h 189h 18ah 18bh (reserved) (reserved) (reserved) (reserved) 198h 199h 19ah 19bh (reserved) (reserved) (reserved) (reserved) 1a8h 1a9h 1aah 1abh (reserved) (reserved) (reserved) (reserved) 1b8h 1b9h 1bah 1bbh (reserved) (reserved) (reserved) (reserved) 18ch 18dh 18eh 18fh (reserved) (reserved) (reserved) (reserved) 19ch 19dh 19eh 19fh (reserved) (reserved) (reserved) (reserved) 1ach 1adh 1aeh 1afh (reserved) (reserved) (reserved) (reserved) 1bch 1bdh 1beh 1bfh (reserved) (reserved) (reserved) (reserved) address name address name address name address name 01c0h 1c1h 1c2h 1c3h (reserved) (reserved) (reserved) (reserved) 01d0h 1d1h 1d2h 1d3h (reserved) (reserved) (reserved) (reserved) 01e0h 1e1h 1e2h 1e3h (reserved) (reserved) (reserved) (reserved) 01f0h 1f1h 1f2h 1f3h (reserved) (reserved) (reserved) (reserved) 1c4h 1c5h 1c6h 1c7h (reserved) (reserved) (reserved) (reserved) 1d4h 1d5h 1d6h 1d7h (reserved) (reserved) (reserved) (reserved) 1e4h 1e5h 1e6h 1e7h (reserved) (reserved) (reserved) (reserved) 1f4h 1f5h 1f6h 1f7h (reserved) (reserved) (reserved) (reserved) 1c8h 1c9h 1cah 1cbh (reserved) (reserved) (reserved) (reserved) 1d8h 1d9h 1dah 1dbh (reserved) (reserved) (reserved) (reserved) 1e8h 1e9h 1eah 1ebh (reserved) (reserved) (reserved) (reserved) 1f8h 1f9h 1fah 1fbh (reserved) (reserved) (reserved) (reserved) 1cch 1cdh 1ceh 1cfh (reserved) (reserved) (reserved) (reserved) 1dch 1ddh 1deh 1dfh (reserved) (reserved) (reserved) (reserved) 1ech 1edh 1eeh 1efh (reserved) (reserved) (reserved) (reserved) 1fch 1fdh 1feh 1ffh (reserved) (reserved) (reserved) (reserved) note: do not access the without allocated names.
tmp92cd54i 2009-12-26 92cd54i-305 tentative table 5.5 i/o register address map (5) [11] can: address name address name address name address name 0200h 201h 202h 203h mb0mi0l mb0mi0h mb0mi1l mb0mi1h 0210h 211h 212h 213h mb1mi0l mb1mi0h mb1mi1l mb1mi1h 0220h 221h 222h 223h mb2mi0l mb2mi0h mb2mi1l mb2mi1h 0230h 231h 232h 233h mb3mi0l mb3mi0h mb3mi1l mb3mi1h 204h 205h 206h 207h mb0mcfl mb0mcfh mb0d0 mb0d1 214h 215h 216h 217h mb1mcfl mb1mcfh mb1d0 mb1d1 224h 225h 226h 227h mb2mcfl mb2mcfh mb2d0 mb2d1 234h 235h 236h 237h mb3mcfl mb3mcfh mb3d0 mb3d1 208h 209h 20ah 20bh mb0d2 mb0d3 mb0d4 mb0d5 218h 219h 21ah 21bh mb1d2 mb1d3 mb1d4 mb1d5 228h 229h 22ah 22bh mb2d2 mb2d3 mb2d4 mb2d5 238h 239h 23ah 23bh mb3d2 mb3d3 mb3d4 mb3d5 20ch 20dh 20eh 20fh mb0d6 mb0d7 mb0tsvl mb0tsvh 21ch 21dh 21eh 21fh mb1d6 mb1d7 mb1tsvl mb1tsvh 22ch 22dh 22eh 22fh mb2d6 mb2d7 mb2tsvl mb2tsvh 23ch 23dh 23eh 23fh mb3d6 mb3d7 mb3tsvl mb3tsvh address name address name address name address name 0240h 241h 242h 243h mb4mi0l mb4mi0h mb4mi1l mb4mi1h 0250h 251h 252h 253h mb5mi0l mb5mi0h mb5mi1l mb5mi1h 0260h 261h 262h 263h mb6mi0l mb6mi0h mb6mi1l mb6mi1h 0270h 271h 272h 273h mb7mi0l mb7mi0h mb7mi1l mb7mi1h 244h 245h 246h 247h mb4mcfl mb4mcfh mb4d0 mb4d1 254h 255h 256h 257h mb5mcfl mb5mcfh mb5d0 mb5d1 264h 265h 266h 267h mb6mcfl mb6mcfh mb6d0 mb6d1 274h 275h 276h 277h mb7mcfl mb7mcfh mb7d0 mb7d1 248h 249h 24ah 24bh mb4d2 mb4d3 mb4d4 mb4d5 258h 259h 25ah 25bh mb5d2 mb5d3 mb5d4 mb5d5 268h 269h 26ah 26bh mb6d2 mb6d3 mb6d4 mb6d5 278h 279h 27ah 27bh mb7d2 mb7d3 mb7d4 mb7d5 24ch 24dh 24eh 24fh mb4d6 mb4d7 mb4tsvl mb4tsvh 25ch 25dh 25eh 25fh mb5d6 mb5d7 mb5tsvl mb5tsvh 26ch 26dh 26eh 26fh mb6d6 mb6d7 mb6tsvl mb6tsvh 27ch 27dh 27eh 27fh mb7d6 mb7d7 mb7tsvl mb7tsvh note: do not access the without allocated names.
tmp92cd54i 2009-12-26 92cd54i-306 tentative table 5.6 i/o register address map (6) [11] can: address name address name address name address name 0280h 281h 282h 283h mb8mi0l mb8mi0h mb8mi1l mb8mi1h 0290h 291h 292h 293h mb9mi0l mb9mi0h mb9mi1l mb9mi1h 02a0h 2a1h 2a2h 2a3h mb10mi0l mb10mi0h mb10mi1l mb10mi1h 02b0h 2b1h 2b2h 2b3h mb11mi0l mb11mi0h mb11mi1l mb11mi1h 284h 285h 286h 287h mb8mcfl mb8mcfh mb8d0 mb8d1 294h 295h 296h 297h mb9mcfl mb9mcfh mb9d0 mb9d1 2a4h 2a5h 2a6h 2a7h mb10mcfl mb10mcfh mb10d0 mb10d1 2b4h 2b5h 2b6h 2b7h mb11mcfl mb11mcfh mb11d0 mb11d1 288h 289h 28ah 28bh mb8d2 mb8d3 mb8d4 mb8d5 298h 299h 29ah 29bh mb9d2 mb9d3 mb9d4 mb9d5 2a8h 2a9h 2aah 2abh mb10d2 mb10d3 mb10d4 mb10d5 2b8h 2b9h 2bah 2bbh mb11d2 mb11d3 mb11d4 mb11d5 28ch 28dh 28eh 28fh mb8d6 mb8d7 mb8tsvl mb8tsvh 29ch 29dh 29eh 29fh mb9d6 mb9d7 mb9tsvl mb9tsvh 2ach 2adh 2aeh 2afh mb10d6 mb10d7 mb10tsvl mb10tsvh 2bch 2bdh 2beh 2bfh mb11d6 mb11d7 mb11tsvl mb11tsvh address name address name address name address name 02c0h 2c1h 2c2h 2c3h mb12mi0l mb12mi0h mb12mi1l mb12mi1h 02d0h 2d1h 2d2h 2d3h mb13mi0l mb13mi0h mb13mi1l mb13mi1h 02e0h 2e1h 2e2h 2e3h mb14mi0l mb14mi0h mb14mi1l mb14mi1h 02f0h 2f1h 2f2h 2f3h mb15mi0l mb15mi0h mb15mi1l mb15mi1h 2c4h 2c5h 2c6h 2c7h mb12mcfl mb12mcfh mb12d0 mb12d1 2d4h 2d5h 2d6h 2d7h mb13mcfl mb13mcfh mb13d0 mb13d1 2e4h 2e5h 2e6h 2e7h mb14mcfl mb14mcfh mb14d0 mb14d1 2f4h 2f5h 2f6h 2f7h mb15mcfl mb15mcfh mb15d0 mb15d1 2c8h 2c9h 2cah 2cbh mb12d2 mb12d3 mb12d4 mb12d5 2d8h 2d9h 2dah 2dbh mb13d2 mb13d3 mb13d4 mb13d5 2e8h 2e9h 2eah 2ebh mb14d2 mb14d3 mb14d4 mb14d5 2f8h 2f9h 2fah 2fbh mb15d2 mb15d3 mb15d4 mb15d5 2cch 2cdh 2ceh 2cfh mb12d6 mb12d7 mb12tsvl mb12tsvh 2dch 2ddh 2deh 2dfh mb13d6 mb13d7 mb13tsvl mb13tsvh 2ech 2edh 2eeh 2efh mb14d6 mb14d7 mb14tsvl mb14tsvh 2fch 2fdh 2feh 2ffh mb15d6 mb15d7 mb15tsvl mb15tsvh note: do not access the without allocated names.
tmp92cd54i 2009-12-26 92cd54i-307 tentative table 5.7 i/o register address map (7) [11] can: address name address name address name address name 0300h 301h 302h 303h mcl mch mdl mdh 0310h 311h 312h 313h lam0l lam0h lam1l lam1h 0320h 321h 322h 323h gifl gifh giml gimh 0330h 331h 332h 333h tspl tsph tscl tsch 304h 305h 306h 307h trsl trsh trrl trrh 314h 315h 316h 317h gam0l gam0h gam1l gam1h 324h 325h 326h 327h mbtifl mbtifh mbrifl mbrifh 334h 335h 336h 337h (reserved) (reserved) (reserved) (reserved) 308h 309h 30ah 30bh tal tah aal aah 318h 319h 31ah 31bh mcrl mcrh gsrl gsrh 328h 329h 32ah 32bh mbiml mbimh cdrl cdrh 338h 339h 33ah 33bh (reserved) (reserved) (reserved) (reserved) 30ch 30dh 30eh 30fh rmpl rmph rmll rmlh 31ch 31dh 31eh 31fh bcr1l bcr1h bcr2l bcr2h 32ch 32dh 32eh 32fh rfpl rfph cecl cech 33ch 33dh 33eh 33fh (reserved) (reserved) (reserved) (reserved) address name 0340h to 3ffh (reserved) note: do not access the without allocated names.
tmp92cd54i 2009-12-26 92cd54i-308 tentative (1) input/output ports port0 symbol name address 7 6 5 4 3 2 1 0 p07 p06 p05 p04 p03 p02 p01 p00 r/w 0 0 0 0 0 0 0 0 p0 port 0 register 00h input/output p07c p06c p05c p04c p03c p02c p01c p00c w 0 0 0 0 0 0 0 0 p0cr port 0 control register 02h (no rmw) 0:input 1:output - - - - - - - p0f w - - - - - - - 0 p0fc port 0 function register 03h (no rmw) 0:port 1:data bus(d7 to d0) port4 symbol name address 7 6 5 4 3 2 1 0 p47 p46 p45 p44 p43 p42 p41 p40 r/w 0 0 0 0 0 0 0 0 p4 port 4 register 10h input/output p47c p46c p45c p44c p43c p42c p41c p40c w 0 0 0 0 0 0 0 0 p4cr port 4 control register 12h (no rmw) 0:input 1:output p47f p46f p45f p44f p43f p42f p41f p40f w 0 0 0 0 0 0 0 0 p4fc port 4 function register 13h (no rmw) 0:port 1:a7 0:port 1:a6 0:port 1:a5 0:port 1:a4 0:port 1:a3 0:port 1:a2 0:port 1:a1 0:port 1:a0 p4cr p4fc p47 p46 p45 p44 p43 p42 p41 p40 0 0 input port 1 0 output port 1 1 (reserved) 0 1 a7 to a0
tmp92cd54i 2009-12-26 92cd54i-309 tentative port7 symbol name address 7 6 5 4 3 2 1 0 - - p75 p74 p73 p72 p71 p70 r/w - - 0 1 1 1 1 1 p7 port 7 register 1ch input/output - - p75c p74c p73c p72c p71c p70c w - - 0 1 1 0 1 1 p7cr port 7 control register 1eh (no rmw) 0:input 1:output - - p75f p74f p73f p72f p71f p70f w - - 0 0 0 0 0 0 p7fc port 7 function register 1fh (no rmw) 0:port 1: wait 0:port 0:port 1: cs 0:port 1:si2 scl2 note 0:port 1: wr 0:port 1: rd note: to switch the p72 output from c-mos to open-drain output, set pnode to 1. portc symbol name address 7 6 5 4 3 2 1 0 - - pc5 pc4 pc3 pc2 pc1 pc0 r/w - - 0 0 0 0 0 0 pc port c register 30h input/output - - pc5c pc4c pc3c pc2c pc1c pc0c w - - 0 0 0 0 0 0 pccr port c control register 32h (no rmw) 0:input 1:output - - pc5f pc4f pc3f pc2f pc1f pc0f w - - 0 0 0 0 0 0 pcfc port c function register 33h (no rmw) 0:port int4 1:to7 0:port 1:to5 0:port int3 ti4 0:port int2 1:to3 0:port 1:to1 0:port int1 ti0
tmp92cd54i 2009-12-26 92cd54i-310 tentative portd symbol name address 7 6 5 4 3 2 1 0 pd7 pd6 pd5 pd4 pd3 pd2 pd1 pd0 r/w 0 0 0 0 0 0 0 0 pd port d 34h input/output pd7c pd6c pd5c pd4c pd3c pd2c pd1c pd0c w 0 0 0 0 0 0 0 0 pdcr port d control register 36h (no rmw) 0:input 1:output pd7f pd6f pd5f pd4f pd3f pd2f pd1f pd0f w 0 0 0 0 0 0 0 0 pdfc port d function register 37h (no rmw) 0:port wuint7 1:tob a23 0:port wuint6 1:toa a22 0:port tib wuint5 1:a21 0:port int7 tia wuint4 1:a20 0:port wuint3 1:to9 a19 0:port wuint2 1:to8 a18 0:port int6 ti9 wuint1 1:a17 0:port int5 ti8 wuint0 1:a16 pdcr pdfc pd7 pd6 pd 5 pd4 pd3 pd2 pd1 pd0 0 0 input port, wuint7 input port, wuint6 input port, tib, wuint5 input port, int7, tia, wuint4 input port, wuint3 input port, wuint2 input port, int6, ti9, wuint1 input port, int5, ti8, wuint0 1 0 output port 1 1 tob toa tib, wuint5 tia, int7, wuint4 to9 to8 ti9, int6, wuint1 ti8, int5, wuint0 0 1 a23 a22 a21 a20 a19 a18 a17 a16
tmp92cd54i 2009-12-26 92cd54i-311 tentative portf symbol name address 7 6 5 4 3 2 1 0 pf7 pf6 pf5 pf4 pf3 pf2 pf1 pf0 r/w 0 0 0 0 0 0 0 0 pf port f 3ch input/output pf7c pf6c pf5c pf4c pf3c pf2c pf1c pf0c w 0 0 0 0 0 0 0 0 pfcr port f control register 3eh (no rmw) 0:input 1:output pf7f pf6f pf5f pf4f pf3f pf2f pf1f pf0f w 0 0 0 0 0 0 0 0 pffc port f function register 3fh (no rmw) 0:port 1:rx 0:port 1:tx 0:port cts1 1:sclk1 0:port 1:rxd1 0:port 1:txd1 0:port cts0 1:sclk0 0:port 1:rxd0 0:port 1:txd0 pfcr pffc pf7 pf6 pf5 pf4 pf3 pf2 pf1 pf0 0 0 input port, rx input port input port, sclk1 (input), cts1 input port, rxd1 input port input port, sclk0 (input), cts0 input port, rxd0 input port 1 0 output port 1 1 rx tx sclk1 (output) rxd1 txd1 sclk0 (output) rxd0 txd0 0 1 rx tx don?t use this setting rxd1 txd1 (open -drain) don?t use this setting rxd0 txd0 (open -drain) portg symbol name address 7 6 5 4 3 2 1 0 pg7 pg6 pg5 pg4 pg3 pg2 pg1 pg0 r pg port g register 40h input portl symbol name address 7 6 5 4 3 2 1 0 - - - - pl3 pl2 pl1 pl0 r pl port l register 54h - - - - input
tmp92cd54i 2009-12-26 92cd54i-312 tentative portm symbol name address 7 6 5 4 3 2 1 0 - - - pm4 pm3 pm2 pm1 pm0 r/w - - - 0 0 0 0 0 pm port m 58h input/output - - - - odem3 odem2 odem1 - r/w - - - - 0 0 0 - pmode port m open drain enable register 59h p m 3 output 0:cmos 1:open drain pm2 output 0:cmos 1:open drain pm1 output 0:cmos 1:open drain - - - pm4c pm3c pm2c pm1c pm0c w - - - 0 0 0 0 0 pmcr port m control register 5ah (no rmw) 0:input 1:output - - - pm4f pm3f pm2f pm1f pm0f w - - - 0 0 0 0 0 pmfc port m function register 5bh (no rmw) 0 : p o r t 1:sck2 0:port 1:seclk a11 0:port 1:miso a10 0:port 1:mosi a9 0:port 1: ss a8 pmcr pmfc - - - pm4 pm3 pm2 pm1 pm0 0 0 - - - input port, sck2 (input) input port input port input port input port, ss 1 0 - output port 1 1 - - - sck2 (output) seclk miso mosi ss 0 1 - - - don?t use this setting a11 a10 a9 a8
tmp92cd54i 2009-12-26 92cd54i-313 tentative portn symbol name address 7 6 5 4 3 2 1 0 - pn6 pn5 pn4 pn3 pn2 pn1 pn0 r/w - 0 0 0 0 0 0 0 pn portn 5ch input/output ode72 oden6 oden5 oden4 - oden2 oden1 - r/w r/w 0 0 0 0 - 0 0 - pnode port n open drain enable register 5dh p72 output 0:cmos 1:open drain pn6 output 0:cmos 1:open drain pn5 output 0:cmos 1:open drain pn4 output 0:cmos 1:open drain pn2 output 0:cmos 1:open drain pn1 output 0:cmos 1:open drain - pn6c pn5c pn4c pn3c pn2c pn1c pn0c w - 0 0 0 0 0 0 0 pncr port n control register 5eh (no rmw) 0:input 1:output - pn6f pn5f pn4f pn3f pn2f pn1f pn0f w w - 0 0 0 0 0 0 0 pnfc port n function register 5fh (no rmw) 0:port 1:so2 sda2 a15 0:port si1 1:scl1 a14 0:port 1:so1 sda1 a13 0:port 1:sck1 a12 0:port si0 1:scl0 0:port 1:so0 sda0 0:port 1:sck0 pncr pnfc - pn6 pn5 pn4 pn3 pn2 pn1 pn0 0 0 - input port input port, si1 input port input port, sck1 (input) input port, si0 input port input port, sck0 (input) 1 0 - output port 1 1 - so2/sd a2 scl1 so1/sd a1 sck1 (output) scl0 so0/sd a0 sck0 (output) 0 1 - a15 a14 a13 a12 don?t use this setting. note: to switch the p72 output from c-mos to open-drain output, set pnode to 1.
tmp92cd54i 2009-12-26 92cd54i-314 tentative (2) 8-bit timers 8-bit timers 01, 23, 45, and 67 symbol name address 7 6 5 4 3 2 1 0 t0rde - - - i2t01 t01prun t1run t0run r/w r/w r/w 0 - - - 0 0 0 0 trun01 8-bit timer01 run register 80h double buffer 0:disable 1:enable idle2 0:stop 1: operate 8-bit timer run/stop control 0:stop & clear 1:run (count up) - w treg0 8-bit timer register 0 82h (no rmw) undefined - w treg1 8-bit timer register 1 83h (no rmw) undefined t01m1 t01m0 pwm01 pwm00 t1clk1 t1clk0 t0clk1 t0clk0 r/w 0 0 0 0 0 0 0 0 tmod01 8-bit timer0,1 source clk & mode register 84h operate mode 00:8-bit timer 01:16-bit timer 10:8-bit ppg 11:8-bit pwm pwm cycle 00:reserved 01:2 6 10:2 7 11:2 8 timer1 source clock 00:t0trg 01: t1 10: t16 11: t256 timer0 source clock 00:ti0 01: t1 10: t4 11: t16 - - - - tff1c1 tff1c0 tff1ie tff1is r/w r/w - - - - 1 1 0 0 tffcr1 timer1 flip-flop control register 85h (no rmw) 00:invert tff1 01:set tff1 10:clear tff1 11:don?t care tff1 invert 0: disable 1:enable tff1 invert 0:timer0 1:timer1 t2rde - - - i2t23 t23prun t3run t2run r/w r/w r/w 0 - - - 0 0 0 0 trun23 8-bit timer23 run register 88h double buffer 0:disable 1:enable idle2 0:stop 1: operate 8-bit timer run/stop control 0:stop & clear 1:run (count up) - w treg2 8-bit timer register 2 8ah (no rmw) undefined - w treg3 8-bit timer register 3 8bh (no rmw) undefined t23m1 t23m0 pwm21 pwm20 t3clk1 t3clk0 t2clk1 t2clk0 r/w 0 0 0 0 0 0 0 0 tmod23 8-bit timer2,3 source clk & mode register 8ch operate mode 00:8-bit timer 01:16-bit timer 10:8-bit ppg 11:8-bit pwm pwm cycle 00:reserved 01:2 6 10:2 7 11:2 8 timer3 source clock 00:t2trg 01: t1 10: t16 11: t256 timer2 source clock 00:reserved 01: t1 10: t4 11: t16
tmp92cd54i 2009-12-26 92cd54i-315 tentative symbol name address 7 6 5 4 3 2 1 0 - - - - tff3c1 tff3c0 tff3ie tff3is r/w r/w - - - - 1 1 0 0 tffcr3 timer3 flip-flop control register 8dh (no rmw) 00:invert tff3 01:set tff3 10:clear tff3 11:don?t care tff3 invert 0: disable 1:enable tff3 invert 0:timer2 1:timer3 t4rde - - - i2t45 t45prun t5run t4run r/w r/w r/w 0 - - - 0 0 0 0 trun45 8-bit timer45 run register 90h double buffer 0: disable 1:enable idle2 0:stop 1: operate 8-bit timer run/stop control 0:stop & clear 1:run (count up) - w treg4 8-bit timer register 4 92h (no rmw) undefined - w treg5 8-bit timer register 5 93h (no rmw) undefined t45m1 t45m0 pwm41 pwm40 t5clk1 t5clk0 t4clk1 t4clk0 r/w 0 0 0 0 0 0 0 0 tmod45 8-bit timer4,5 source clk & mode register 94h operate mode 00:8-bit timer 01:16-bit timer 10:8-bit ppg 11:8-bit pwm pwm cycle 00:reserved 01:2 6 10:2 7 11:2 8 timer5 source clock 00:t4trg 01: t1 10: t16 11: t256 timer4 source clock 00:ti4 01: t1 10: t4 11: t16 - - - - tff5c1 tff5c0 tff5ie tff5is r/w r/w - - - - 1 1 0 0 tffcr5 timer5 flip-flop control register 95h (no rmw) 00:invert tff5 01:set tff5 10:clear tff5 11:don?t care tff5 invert 0: disable 1:enable tff5 invert 0:timer4 1:timer5 t6rde - - - i2t67 t67prun t7run t6run r/w r/w r/w 0 - - - 0 0 0 0 trun67 8-bit timer67 run register 98h double buffer 0: disable 1:enable idle2 0:stop 1: operat e 8-bit timer run/stop control 0:stop & clear 1:run (count up) - w treg6 8-bit timer register 6 9ah (no rmw) undefined - w treg7 8-bit timer register 7 9bh (no rmw) undefined
tmp92cd54i 2009-12-26 92cd54i-316 tentative symbol name address 7 6 5 4 3 2 1 0 t67m1 t67m0 pwm61 pwm60 t7clk1 t7clk0 t6clk1 t6clk0 r/w 0 0 0 0 0 0 0 0 tmod67 8-bit timer6,7 source clk & mode register 9ch operate mode 00:8-bit timer 01:16-bit timer 10:8-bit ppg 11:8-bit pwm pwm cycle 00:reserved 01:2 6 10:2 7 11:2 8 timer7 source clock 00:t6trg 01: t1 10: t16 11: t256 timer6 source clock 00:reserved 01: t1 10: t4 11: t16 - - - - tff7c1 tff7c0 tff7ie tff7is r/w r/w - - - - 1 1 0 0 tffcr7 timer7 flip-flop control register 9dh (no rmw) 00:invert tff7 01:set tff7 10:clear tff7 11:don?t care tff7 invert 0: disable 1:enable tff7 invert 0:timer6 1:timer7
tmp92cd54i 2009-12-26 92cd54i-317 tentative (3) 16-bit timers 16-bit timers 8 and a symbol name address 7 6 5 4 3 2 1 0 t8rde - - - i2t8 t8prun - t8run r/w r/w r/w r/w r/w 0 0 - - 0 0 - 0 trun8 16-bit timer8 run register a0h double buffer 0: disable 1:enable fix to ?0? idle2 0:stop 1: operate 16-bit timer run/stop control 0:stop & clear 1:run (count up) cap9t9 eq9t9 cap8in cap89m1 cap89m0 t8cle t8clk1 t8clk0 r/w w r/w 0 0 1 0 0 0 0 0 tmod8 16-bit timer8 source clk & mode register a2h tff9 invert trigger 0: disable 1: enable 0:soft capture 1:don?t care capture timing 00:disable 01:ti8 ti9 10:ti8 ti8 11:tff1 tff1 1:uc8 clear enable source clock 00:ti8 01: t1 10: t4 11: t16 tff9c1 tff9c0 cap9t8 cap8t8 eq9t8 eq8t8 tff8c1 tff8c0 w r/w w 1 1 0 0 0 0 1 1 tffcr8 16-bit timer8 flip-flop control register a3h 00:invert tff9 01:set tff9 10:clear tff9 11:don?t care tff8 invert trigger 0: disable 1: enable 00:invert tff8 01:set tff8 10:clear tff8 11:don?t care - w treg8l 16-bit timer register 8 low a8h (no rmw) undefined - w treg8h 16-bit timer register 8 high a9h (no rmw) undefined - w treg9l 16-bit timer register 9 low aah (no rmw) undefined - w treg9h 16-bit timer register 9 high abh (no rmw) undefined - r cap8l capture register 8 low ach undefined - r cap8h capture register 8 high adh undefined - r cap9l capture register 9 low aeh undefined - r cap9h capture register 9 high afh undefined
tmp92cd54i 2009-12-26 92cd54i-318 tentative symbol name address 7 6 5 4 3 2 1 0 tarde - - - i2ta taprun - tarun r/w r/w r/w r/w r/w 0 0 - - 0 0 - 0 truna 16-bit timera run register b0h double buffer 0: disable 1:enable fix to ?0? idle2 0:stop 1: operate 16-bit timer run/stop control 0:stop & clear 1:run (count up) capbtb eqbtb capain capabm1 capabm0 tacle taclk1 taclk0 r/w w r/w 0 0 1 0 0 0 0 0 tmoda 16-bit timera source clk & mode register b2h tffb invert trigger 0: disable 1: enable 0:soft capture 1:don?t care capture timing 00:disable 01:tia tib 10:tia tia 11:tff1 tff1 1:uca clear enable source clock 00:tia 01: t1 10: t4 11: t16 tffbc1 tffbc0 capbta capata eqbta eqata tffac1 tffac0 w r/w w 1 1 0 0 0 0 1 1 tffcra 16-bit timera flip-flop control register b3h 00:invert tffb 01:set tffb 10:clear tffb 11:don?t care tffa invert trigger 0: disable 1: enable 00:invert tffa 01:set tffa 10:clear tffa 11:don?t care - w tregal 16-bit timer register a low b8h (no rmw) undefined - w tregah 16-bit timer register a high b9h (no rmw) undefined - w tregbl 16-bit timer register b low bah (no rmw) undefined - w tregbh 16-bit timer register b high bbh (no rmw) undefined - r capal capture register a low bch undefined - r capah capture register a high bdh undefined - r capbl capture register b low beh undefined - r capbh capture register b high bfh undefined
tmp92cd54i 2009-12-26 92cd54i-319 tentative (4) serial channels symbol name address 7 6 5 4 3 2 1 0 rb7 tb7 rb6 tb6 rb5 tb5 rb4 tb4 rb3 tb3 rb2 tb2 rb1 tb1 rb0 tb0 r(receiving) / w(transmission) sc0buf serial channel 0 buffer register c0h (no rmw) undefined rb8 even pe oerr perr ferr sclks ioc r r/w r (clear 0 after reading) r/w undefined 0 0 0 0 0 0 0 1:error sc0cr serial channel 0 control register c1h receive data bit 8 parity 0:odd 1:even parity 0: disable 1:enable overrun parity framing 0:sclk0 1:sclk0 0:baud rate g enerator 1:sclk0 pin input tb8 ctse rxe wu sm1 sm0 sc1 sc0 r/w undefined 0 0 0 0 0 0 0 sc0mod0 serial channel 0 mode 0 register c2h transmiss ion d ata bit 8 0:cts disable 1:cts enable 0: r eceive d isable 1: r eceive enable wake up 0: d isable 1:enable 00:i/o interface mode 01:7bit uart mode 10:8bit uart mode 11:9bit uart mode 00:timertotrg 01:baud rate generator 10:internal clock 1 11:external clock (sclk0 input) - br0adde br0ck1 br0ck0 br0s3 br0s2 br0s1 br0s0 r/w 0 0 0 0 0 0 0 0 br0cr serial channel 0 baud rate control register c3h fix to ?0? (16-k)/16 divided 0:disable 1:enable 00: t0 01: t2 10: t8 11: t32 set the frequency divisor ?n? 0 to f - - - - br0k3 br0k2 br0k1 br0k0 r / w - - - - 0 0 0 0 br0add serial channel 0 k setting register c4h set the frequency divisor ?k? (1 to f) i2s0 fdpx0 - - - - - - r/w r/w 0 0 - - - - - - sc0mod1 serial channel 0 mode 1 register c5h idle2 0:stop 1: o perate i/o interface mode 1:full duplex 0:half duplex
tmp92cd54i 2009-12-26 92cd54i-320 tentative symbol name address 7 6 5 4 3 2 1 0 rb7 tb7 rb6 tb6 rb5 tb5 rb4 tb4 rb3 tb3 rb2 tb2 rb1 tb1 rb0 tb0 r(receiving) / w(transmission) sc1bu f serial channel 1 buffer register c8h (no rmw) undefined rb8 even pe oerr perr ferr sclks ioc r r/w r (clear 0 after reading) r/w undefined 0 0 0 0 0 0 0 1:error sc1cr serial channel 1 control register c9h receive data bit 8 parity 0:odd 1:even parity 0: d isable 1:enable overrun parity framing 0:sclk1 1:sclk1 0:baud rate g enerator 1:sclk1 pin input tb8 ctse rxe wu sm1 sm0 sc1 sc0 r/w undefined 0 0 0 0 0 0 0 sc1mo d0 serial channel 1 mode 0 register cah transmiss ion data bit 8 0:cts disable 1:cts enable 0: r eceive d isable 1: r eceive enable wake up 0: d isable 1:enable 00: i/o interface m ode 01:7bit uart mode 10:8bit uart mode 11:9bit uart mode 00:timertotrg 01:baud rate generator 10:internal clock 1 11:external clock (sclk1 input) - br1add e br1ck1 br1ck0 br1s3 br1s2 br1s1 br1s0 r/w 0 0 0 0 0 0 0 0 br1cr serial channel 1 baud rate control register cbh fix to ?0? (16-k) / 16 divided 0: d isable 1:enable 00: t0 01: t2 10: t8 11: t32 set the frequency divisor ?n? 0 to f - - - - br1k3 br1k2 br1k1 br1k0 r/w - - - - 0 0 0 0 br1ad d serial channel 1 k setting register cch set the frequency divisor ?k? (1 to f) i2s1 fdpx1 - - - - - - r/w r/w 0 0 - - - - - - sc1mo d1 serial channel 1 mode 1 register cdh idle2 0:stop 1:operate i/o interface mode 1:full duplex 0:half duplex
tmp92cd54i 2009-12-26 92cd54i-321 tentative (5) serial expansion interface (sei) symbol name address 7 6 5 4 3 2 1 0 mode see bos mstr cpol cpha ser1 ser0 w r/w 0 0 0 0 0 1 1 1 secr sei control register 60h sei0 modf d etection 0:enable 1: d isable sei s ystem enable 0:stop 1:run bit order s elect bit 0:msb 1:lsb master select bit 0:slave 1:master clock polarity selection see figure 3.11.2, 3.11.3 clock phase selection see figure 3.11.2, 3.11.3 sei transfer rate select 00:reserved 01:divided by 2 10:divided by 4 11:divided by 16 sef wcol sovf modf - - - tmse r r/w 0 0 0 0 - - - 0 sei transfer 0:busy or stop 1:end wcol flag 1:error sovf flag (slave) 1:error modf flag (master) 1:error s e i m o d e select 0:compati bility mode 1:micro dma mode - wcol sovf modf tsrc tstc tasm tmse r/c r/w - 0 0 0 0 0 0 0 sesr sei status register 61h wcol flag 1:error sovf flag (slave) 1:error modf flag (master) 1:error sei receive 1:end sei transfer 1:end auto shift enable (master) intsee0 mask (slave) sei mode select 0:compati bility mode 1:micro dma mode sed7 sed6 sed5 sed4 sed3 sed2 sed1 sed0 r(reception)/w(transmission) 0 0 0 0 0 0 0 0 sedr sei data register 62h receive data / transfer data
tmp92cd54i 2009-12-26 92cd54i-322 tentative (6) interrupt controller symbol name address 7 6 5 4 3 2 1 0 intad int0 iadc iadm2 iadm1 iadm0 ioc iom2 iom1 iom0 r r/w r r/w inte0ad int0 & intad enable register f0h 0 0 0 0 0 0 0 0 int2 int1 i2c i2m2 i2m1 i2m0 i1c i1m2 i1m1 i1m0 r r/w r r/w inte12 int1 & int2 enable register d0h 0 0 0 0 0 0 0 0 int4 int3 i4c i4m2 i4m1 i4m0 i3c i3m2 i3m1 i3m0 r r/w r r/w inte34 int3 & int4 enable register d1h 0 0 0 0 0 0 0 0 int6(cap9) int5(cap8) i6c i6m2 i6m1 i6m0 i5c i5m2 i5m1 i5m0 r r/w r r/w inte56 int5 & int6 enable register d2h 0 0 0 0 0 0 0 0 int7(capa) - - - - i7c i7m2 i7m1 i7m0 r r/w inte7 int7 enable register d3h - - - - 0 0 0 0 intt1(timer1) intt0(timer0) it1c it1m2 it1m1 it1m0 it0c it0m2 it0m1 it0m0 r r/w r r/w intet01 intt0 & intt1 enable register d4h 0 0 0 0 0 0 0 0 intt3(timer3) intt2(timer2) it3c it3m2 it3m1 it3m0 it2c it2m2 it2m1 it2m0 r r/w r r/w intet23 intt2 & intt3 enable register d5h 0 0 0 0 0 0 0 0 intt5(timer5) intt4(timer4) it5c it5m2 it5m1 it5m0 it4c it4m2 it4m1 it4m0 r r/w r r/w intet45 intt4 & intt5 enable register d6h 0 0 0 0 0 0 0 0 intt7(timer7) intt6(timer6) it7c it7m2 it7m1 it7m0 it6c it6m2 it6m1 it6m0 r r/w r r/w intet67 intt6 & intt7 enable register d7h 0 0 0 0 0 0 0 0 inttr9(timer8) inttr8(timer8) it9c it9m2 it9m1 it9m0 it8c it8m2 it8m1 it8m0 r r/w r r/w intet89 inttr8 & inttr9 enable register d8h 0 0 0 0 0 0 0 0 inttrb(timera) inttra(timera) itbc itbm2 itbm1 itbm0 itac itam2 itam1 itam0 r r/w r r/w intetab inttra & inttrb enable register d9h 0 0 0 0 0 0 0 0 inttoa intto8 itoac itoam2 itoam1 itoam0 ito8c ito8m2 ito8m1 ito8m0 r r/w r r/w inteto8 a intto8 & inttoa (overflow) enable register dah 0 0 0 0 0 0 0 0
tmp92cd54i 2009-12-26 92cd54i-323 tentative symbol name address 7 6 5 4 3 2 1 0 inttx0 intrx0 itx0c itx0m2 itx0m1 itx0m0 irx0c irx0m2 irx0m1 irx0m0 r r/w r r/w intes0 intrx0 & inttx0 enable register dbh 0 0 0 0 0 0 0 0 inttx1 intrx1 itx1c itx1m2 itx1m1 itx1m0 irx1c irx1m2 irx1m1 irx1m0 r r/w r r/w intes1 intrx1 & inttx1 enable register dch 0 0 0 0 0 0 0 0 intct intcr ictc ictm2 ictm1 ictm0 icrc icrm2 icrm1 icrm0 r r/w r r/w intecrt intcr & intct enable register ddh 0 0 0 0 0 0 0 0 intcg - - - - icgc icgm2 icgm1 icgm0 r r/w intecg intcg enable register deh - - - - 0 0 0 0 intsee0 intsem0 isee0c isee0m2 isee0m1 isee0m0 isem0c isem0m 2 isem0m 1 isem0m 0 r r/w r r/w intesee 0 intsem0 & intsee0 enable register dfh 0 0 0 0 0 0 0 0 intset0 intser0 iset0c iset0m2 iset0m1 iset0m0 iser0c iser0m2 iser0m1 iser0m0 r r/w r r/w intesed 0 intser0 & intset0 enable register e0h 0 0 0 0 0 0 0 0 i n t r t c - - - - irtcc irtcm2 irtcm1 irtcm0 r r/w intertc intrtc enable e1h - - - - 0 0 0 0 intsbs2 intsbe2 isbs0c isbs0m2 isbs0m1 isbs0m0 isbe0c isbe0m2 isbe0m1 isbe0m0 r r/w r r/w intesb2 intsbe2 & intsbs2 enable register e2h 0 0 0 0 0 0 0 0 intsbs0 intsbe0 isbs0c isbs0m2 isbs0m1 isbs0m0 isbe0c isbe0m2 isbe0m1 isbe0m0 r r/w r r/w intesb0 intsbe0 & intsbs0 enable register e3h 0 0 0 0 0 0 0 0 intsbs1 intsbe1 isbs1c isbs1m2 isbs1m1 isbs1m0 isbe1c isbe1m2 isbe1m1 isbe1m0 r r/w r r/w intesb1 intsbe1 & intsbs1 enable register e4h 0 0 0 0 0 0 0 0 mki7 mki6 mki5 mki4 mki3 mki2 mki1 mki0 r/w 1 1 1 1 1 1 1 1 intmk0 interrupt mask control 0 e5h 0: mask 1: enable 0: mask 1: enable 0: mask 1: enable 0: mask 1: enable 0: mask 1: enable 0: mask 1: enable 0: mask 1: enable 0: mask 1: enable mkit7 mkit6 mkit5 mkit4 mkit3 mkit2 mkit1 mkit0 r/w r/w r/w r/w r/w r/w r/w r/w 1 1 1 1 1 1 1 1 intmk1 interrupt mask control 1 e6h 0: mask 1: enable 0: mask 1: enable 0: mask 1: enable 0: mask 1: enable 0: mask 1: enable 0: mask 1: enable 0: mask 1: enable 0: mask 1: enable
tmp92cd54i 2009-12-26 92cd54i-324 tentative symbol name address 7 6 5 4 3 2 1 0 - mkirtc mkitda mkitd mkitrb mkitra mkitr9 mkitr8 r/w r/w r/w r/w r/w r/w r/w - 1 1 1 1 1 1 1 intmk2 interrupt mask control 2 e7h 0: mask 1: enable 0: mask 1: enable 0: mask 1: enable 0: mask 1: enable 0: mask 1: enable 0: mask 1: enable 0: mask 1: enable - mkicg mkict mkicr mkitx1 mkirx1 mkitx0 mkirx0 r/w r/w r/w r/w r/w r/w r/w - 1 1 1 1 1 1 1 intmk3 interrupt mask control 3 e8h 0: mask 1: enable 0: mask 1: enable 0: mask 1: enable 0: mask 1: enable 0: mask 1: enable 0: mask 1: enable 0: mask 1: enable - - - - mkiset 0 mkiser 0 mkisee 0 mkisem 0 r/w r/w r/w r/w - - - - 1 1 1 1 intmk4 interrupt mask control 4 e9h 0: mask 1: enable 0: mask 1: enable 0: mask 1: enable 0: mask 1: enable - mkisbs2 mkisbe2 mkiad mkisbe 1 mkisbe 1 mkisbs 0 mkisbe 0 r/w r/w r/w r/w r/w r/w r/w - 1 1 1 1 1 1 1 intmk5 interrupt mask control 5 eah 0: mask 1: enable 0: mask 1: enable 0: mask 1: enable 0: mask 1: enable 0: mask 1: enable 0: mask 1: enable 0: mask 1: enable wflg7 wflg6 wflg5 wflg4 w flg3 wflg2 wflg1 wflg0 r 0 0 0 0 0 0 0 0 wupflag wake-up flag control register ech wuint7 0:no- request 1:request wuint6 0:no- request 1:request wuint5 0:no- request 1:request wuint4 0:no- request 1:request wuint3 0:no- request 1:request wuint2 0:no- request 1:request wuint1 0:no- request 1:request wuint0 0:no- request 1:request wmd7 wmd6 wmd5 wmd4 wmd3 wmd2 wmd1 wmd0 r/w 0 0 0 0 0 0 0 0 wupmod wake-up mode control register edh wuint7 0:falling & rising edge 1:falling or rising edge wuint6 0:falling & rising edge 1:falling or rising edge wuint5 0:falling & rising edge 1:falling or rising edge wuint4 0:falling & rising edge 1:falling or rising edge wuint3 0:falling & rising edge 1:falling or rising edge wuint2 0:falling & rising edge 1:falling or rising edge wuint1 0:falling & rising edge 1:falling or rising edge wuint0 0:falling & rising edge 1:falling or rising edge wed7 wed6 wed5 wed4 wed3 wed2 wed1 wed0 r/w 0 0 0 0 0 0 0 0 wupedge wake-up edge select register eeh wuint7 0:falling edge 1:rising edge wuint6 0:falling edge 1:rising edge wuint5 0:falling edge 1:rising edge wuint4 0:falling edge 1:rising edge wuint3 0:falling edge 1:rising edge wuint2 0:falling edge 1:rising edge wuint1 0:falling edge 1:rising edge wuint0 0:falling edge 1:rising edge wmk7 wmk6 wmk5 wmk4 wmk3 wmk2 wmk1 wmk0 r/w 0 0 0 0 0 0 0 0 wupmask wake-up mask register efh wuint7 0:disable 1:enable wuint6 0:disable 1:enable wuint5 0:disable 1:enable wuint4 0:disable 1:enable wuint3 0:disable 1:enable wuint2 0:disable 1:enable wuint1 0:disable 1:enable wuint0 0:disable 1:enable
tmp92cd54i 2009-12-26 92cd54i-325 tentative symbol name address 7 6 5 4 3 2 1 0 inttc1(dma1) inttc0(dma0) itc1c itc1m2 itc1m1 itc1m0 itc0c itc0m2 itc0m1 itc0m0 r r/w r r/w intetc01 inttc0 & inttc1 enable register f1h 0 0 0 0 0 0 0 0 inttc3(dma3) inttc2(dma2) itc3c itc3m2 itc3m1 itc3m0 itc2c itc2m2 itc2m1 itc2m0 r r/w r r/w intetc23 inttc2 & inttc3 enable register f2h 0 0 0 0 0 0 0 0 inttc5(dma5) inttc4(dma4) itc5c itc5m2 itc5m1 itc5m0 itc4c itc4m2 itc4m1 itc4m0 r r/w r r/w intetc45 inttc4 & inttc5 enable register f3h 0 0 0 0 0 0 0 0 inttc7(dma7) inttc6(dma6) itc7c itc7m2 itc7m1 itc7m0 itc6c itc6m2 itc6m1 itc6m0 r r/w r r/w intetc67 inttc6 & inttc7 enable register f4h 0 0 0 0 0 0 0 0 nmi intwd inmic - - - iwdc - - - r r intnmwd t nmi & intwd enable register f7h 0 - - - 0 - - - - - - - - - iole nmiree r / w - - - - - - 0 0 iimc interrupt input mode control register f6h (no rmw) 0 : i n t 0 edge mode 1:int0 level mode 1:operate even at nmi rise edge - - - - - - - - w 0 0 0 0 0 0 0 0 intclr interrupt clear control register f8h (no rmw) interrupt vector
tmp92cd54i 2009-12-26 92cd54i-326 tentative (7) dma controller symbol name address 7 6 5 4 3 2 1 0 dma0 start vector - - dma0v5 dma0v4 dma0v3 dma0v2 dma0v1 dma0v0 r/w dma0v dma0 start vector register 100h (no rmw) - - 0 0 0 0 0 0 dma1 start vector - - dma1v5 dma1v4 dma1v3 dma1v2 dma1v1 dma1v0 r/w dma1v dma1 start vector register 101h (no rmw) - - 0 0 0 0 0 0 dma2 start vector - - dma2v5 dma2v4 dma2v3 dma2v2 dma2v1 dma2v0 r/w dma2v dma2 start vector register 102h (no rmw) - - 0 0 0 0 0 0 dma3 start vector - - dma3v5 dma3v4 dma3v3 dma3v2 dma3v1 dma3v0 r/w dma3v dma3 start vector register 103h (no rmw) - - 0 0 0 0 0 0 dma4 start vector - - dma4v5 dma4v4 dma4v3 dma4v2 dma4v1 dma4v0 r/w dma4v dma4 start vector register 104h (no rmw) - - 0 0 0 0 0 0 dma5 start vector - - dma5v5 dma5v4 dma5v3 dma5v2 dma5v1 dma5v0 r/w dma5v dma5 start vector register 105h (no rmw) - - 0 0 0 0 0 0 dma6 start vector - - dma6v5 dma6v4 dma6v3 dma6v2 dma6v1 dma6v0 r/w dma6v dma6 start vector register 106h (no rmw) - - 0 0 0 0 0 0 dma7 start vector - - dma7v5 dma7v4 dma7v3 dma7v2 dma7v1 dma7v0 r/w dma7v dma7 start vector register 107h (no rmw) - - 0 0 0 0 0 0 dma burst dbst7 dbst6 dbst5 dbst4 dbst3 dbst2 dbst1 dbst0 r/w dmab dma burst register 108h (no rmw) 0 0 0 0 0 0 0 0 dma request dreq7 dreq6 dreq5 dreq4 dre q3 dreq2 dreq1 dreq0 r/w dmar dma request register 109h (no rmw) 0 0 0 0 0 0 0 0
tmp92cd54i 2009-12-26 92cd54i-327 tentative (8) control registers symbol name address 7 6 5 4 3 2 1 0 haltm1 haltm0 - - - clkoe clkm1 clkm0 r/w r/w r/w 1 1 - 0 - 0 0 0 clkmod clock mode register 10ah halt mode 00:idle3 mode 01:stop mode 10:idle1 mode 11:idle2 mode fixed to ?0? clk output enable 0 high-z (pull up) 1 output 00:fc output 01:(reserved) 10:2/5 ? fc output 11:(reserved) wdte wdtp1 wdtp0 - drve i2wdt rescr - r/w r/w 1 0 0 - 0 0 0 0 wdmod watchdog timer mode register 110h 1:wdt enable 00 : 2 16 /fc 01 : 2 18 /fc 10 : 2 20 /fc 11 : 2 22 /fc 1:drive pin in stop mode idle2 0:stop 1:operat e 1:reset connect internally wdt out to reset pin fix to ?0? - w - wdcr watchdog timer control register 111h b1h : wdt disable 4eh : wdt clear
tmp92cd54i 2009-12-26 92cd54i-328 tentative (9) ad converter symbol name address 7 6 5 4 3 2 1 0 eocf adbf - - itm0 repet scan ads r r/w 0 0 0 0 0 0 0 0 admod0 ad mode control register 0 138h ad conversion end flag 1:end ad conversion busy flag 1:busy fix to ?0? fix to ?0? 0: every 1 time 1: every 4 times repeat mode 0:single mode 1:repeat mode scan mode 0:fixed channel mode 1:channel scan mode ad conversi on start 1:start always read as ?0? vrefon i2ad - - adch3 adch2 adch1 adch0 r/w r/w r/w 0 0 0 0 0 0 0 0 admod1 ad mode control register 1 139h string resistance 0:off 1:on idle2 0:stop 1:operate fix to ?0? fix to ?0? input channel 0000: an0 an0 : : 1011: an11 an0 an1 an2 an11 1100, 1101, 1110, 1111: reserved adr01 adr00 - - - - - adr0rf r r r adreg0l ad result register 0 low 120h undefined - - - - - 0 adr09 adr08 adr07 adr06 adr05 adr04 adr03 adr02 r adreg0h ad result register 0 high 121h undefined adr11 adr10 - - - - - adr1rf r r adreg1l ad result register 1 low 122h undefined - - - - - 0 adr19 adr18 adr17 adr16 adr15 adr14 adr13 adr12 r adreg1h ad result register 1 high 123h undefined adr21 adr20 - - - - - adr2rf r r adreg2l ad result register 2 low 124h undefined - - - - - 0 adr29 adr28 adr27 adr26 adr25 adr24 adr23 adr22 r adreg2h ad result register 2 high 125h undefined adr31 adr30 - - - - - adr3rf r r adreg3l ad result register 3 low 126h undefined - - - - - 0 adr39 adr38 adr37 adr36 adr35 adr34 adr33 adr32 r adreg3h ad result register 3 high 127h undefined
tmp92cd54i 2009-12-26 92cd54i-329 tentative symbol name address 7 6 5 4 3 2 1 0 adr41 adr40 - - - - - adr4rf r r adreg4l ad result register 4 low 128h undefined - - - - - 0 adr49 adr48 adr47 adr46 adr45 adr44 adr43 adr42 r adreg4h ad result register 4 high 129h undefined adr51 adr50 - - - - - adr5rf r r adreg5l ad result register 5 low 12ah undefined - - - - - 0 adr59 adr58 adr57 adr56 adr55 adr54 adr53 adr52 r adreg5h ad result register 5 high 12bh undefined adr61 adr60 - - - - - adr6rf r r adreg6l ad result register 6 low 12ch undefined - - - - - 0 adr69 adr68 adr67 adr66 adr65 adr64 adr63 adr62 r adreg6h ad result register 6 high 12dh undefined adr71 adr70 - - - - - adr7rf r r adreg7l ad result register 7 low 12eh undefined - - - - - 0 adr79 adr78 adr77 adr76 adr75 adr74 adr73 adr72 r adreg7h ad result register 7 high 12fh undefined adr81 adr80 - - - - - adr8rf r r adreg8l ad result register 8 low 130h undefined - - - - - 0 adr89 adr88 adr87 adr86 adr85 adr84 adr83 adr82 r adreg8h ad result register 8 high 131h undefined adr91 adr90 - - - - - adr9rf r r adreg9l ad result register 9 low 132h undefined - - - - - 0 adr99 adr98 adr97 adr96 adr95 adr94 adr93 adr92 r adreg9h ad result register 9 high 133h undefined adra1 adra0 - - - - - adrarf r r adregal ad result register a low 134h undefined - - - - - 0 adra9 adra8 adra7 adra6 adra5 adra4 adra3 adra2 r adregah ad result register a high 135h undefined adrb1 adrb0 - - - - - adrbrf r r adregbl ad result register b low 136h undefined - - - - - 0 adrb9 adrb8 adrb7 adrb6 adrb5 adrb4 adrb3 adrb2 r adregbh ad result register b high 137h undefined
tmp92cd54i 2009-12-26 92cd54i-330 tentative (10) memory controller symbol name address 7 6 5 4 3 2 1 0 - bww2 bww1 bww0 - bwr2 bwr1 bwr0 w w - 0 1 0 - 0 1 0 bcsl block cs/wait control register low 148h number of write waits 001:0wait 010:1wait 011:nwait 101:2wait 110:3wait others : reserved number of read waits 001:0wait 010:1wait 011:nwait 101:2wait 110:3wait others : reserved be bm - - bom1 bom0 bbus1 bbus0 w w w w 1 0 0 0 0 0 0 0 bcsh block cs/wait control register high 149h cs select 0:disable 1:enable 0:16mb 1:sets area fix to ?0? fix to ?0? 00:sram/rom 01,10,11:resetved 00:8bit 01,10,11:reserved mv22 mv21 mv20 mv19 mv18 mv17 mv16 mv15 r/w 1 1 1 1 1 1 1 1 mamr memory register 14ah 0:compare enable 1:compare disable ms23 ms22 ms21 ms20 ms19 ms18 ms17 ms16 r/w 1 1 1 1 1 1 1 1 msar memory start address register 14bh set start address a23 to a16 - - - - - - - - r/w 0 0 0 0 0 0 0 0 (note2) fswe flash security write enable register 16bh c9h: auto chip erase & unprotect command enable code others: auto chip erase & unprotect command disable code ramstb ramwi - - - - - - r / w 0 (note1) 1 - - - - - - ramcr ram write control register 16dh 0: lost data or power on reset 1: kept data ram write 0:disable 1:enable - - - - - r/bsy - - r/w r/w r/w r/w r 0 0 0 0 - 1 - - (note2) flsr flash status register 16eh set to 0. set to 0. set to 0. set to 0. ready /busy flag 0:busy (auto ope -ration in progress) 1:ready (auto operation finished) note1: this register is contained only in t he tmp92fd54ai. it does not exist in the tmp92cd54i. note2: this bit is initialized to 0 upon a power-on reset but not affected by a warm reset (a reset applied when the power is on).
tmp92cd54i 2009-12-26 92cd54i-331 tentative (11) serial bus interface (sbi) symbol name address 7 6 5 4 3 2 1 0 bc2 bc1 bc0 ack sck3 sck2 sck1 swrmon/ sck0 w r/w w r/w 0 0 0 0 1 0 0 1/0 170h (no rmw) i2c mode number of transfer bits 000:8 001:1 010:2 011:3 100:4 101:5 110:6 111:7 acknowled ge mode 0:disable 1:enable setting of the divide value ?n? / fast / standard 0001: ? 0010: ? 0011: 8 0100: 9 0101: 10 0110:11 1000:fast 1111:standard other: reserved sios sioinh siom1 siom0 - sck2 sck1 sck0 w w w 0 0 0 0 1 0 0 0 sbi0cr1 sbi0 control register 1 170h (no rmw) sio mode transfer 0:stop 1:start transfer 0:continue 1:abort transfer mode 00:8bit transmit 10:8bit transmit/receive 11:8bit receive note) write 0 to this bit in sio mode. setting of the divide value ?n? 000:4 001:5 010:6 011:7 100:8 101:9 110:10 111:external clock sck0 rb7/tb7 rb6/tb6 rb5/tb5 rb4/tb4 rb3/tb3 rb2/tb2 rb1/tb1 rb0/tb0 r(receiving)/w(transmission) sbi0dbr sbi0 buffer register 171h (no rmw) undefine sa6 sa5 sa4 sa3 sa2 sa1 sa0 als w 0 0 0 0 0 0 0 0 i2c0ar i2cbus0 address register 172h (no rmw) setting slave address address recognition 0:enable 1:disable mst trx bb pin sbim1 sbim0 swrst1 swrst0 w 0 0 0 1 0 0 0 0 173h (no rmw) i2c mode 0:slave 1:master 0:receive 1:transmit start/stop generation 0:stop 1:start intsbe0 interrupt 0:request 1:cancel operation mode selection 00:port mode 10:i2c mode 01:sio mode 11:reserved software reset generate write ?10? and ?01?, then an internal reset signal is generated. - - - - sbim1 sbim0 - - w w w - - - - 0 0 0 0 sbi0cr2 sbi0 control register 2 173h (no rmw) sio mode operation mode selection 00:port mode 10:i2c mode 01:sio mode 11:reserved fix to ?00? mst trx bb pin al aas ad0 lrb r 0 0 0 1 0 0 0 0 173h (no rmw) i2c mode 0:slave 1:master 0:receive 1:transmit bus status monitor 0:free 1:busy intsbe0 interrupt 0:request 1:cancel arbitration lost detection monitor 1:detect slave address match detection monitor 1:detect general call detection 1:detect last receive bit monitor 0: ?0? 1: ?1? - - - - siof sef - - r - - - - 0 0 - - sbi0sr sbi0 status register 173h (no rmw) sio mode transfer status 0:stopped 1:in progress shift status 0:stopped 1:in progress
tmp92cd54i 2009-12-26 92cd54i-332 tentative symbol name address 7 6 5 4 3 2 1 0 bc2 bc1 bc0 ack sck3 sck2 sck1 swrmon/ sck0 w r/w w r/w 0 0 0 0 1 0 0 1/0 178h (no rmw) i2c mode number of transfer bits 000:8 001:1 010:2 011:3 100:4 101:5 110:6 111:7 acknowled ge mode 0:disable 1:enable setting of the divide value ?n? / fast / standard 0001: ? 0010: ? 0011: 8 0100: 9 0101: 10 0110:11 1000:fast 1111:standard other: reserved sios sioinh siom1 siom0 - sck2 sck1 sck0 w w w 0 0 0 0 1 0 0 0 sbi1cr1 sbi1 control register 1 178h (no rmw) sio mode transfer 0:stop 1:start transfer 0:continue 1:abort transfer mode 00:8bit transmit 10:8bit transmit/receive 11:8bit receive note) write 0 to this bit in sio mode. setting of the divide value ?n? 000:4 001:5 010:6 011:7 100:8 101:9 110:10 111:external clock sck1 rb7/tb7 rb6/tb6 rb5/tb5 rb4/tb4 rb3/tb3 rb2/tb2 rb1/tb1 rb0/tb0 r(receiving)/w(transmission) sbi1dbr sbi1 buffer register 179h (no rmw) undefine sa6 sa5 sa4 sa3 sa2 sa1 sa0 als w 0 0 0 0 0 0 0 0 i2c1ar i2cbus1 address register 17ah (no rmw) setting slave address address recognition 0:enable 1:disable mst trx bb pin sbim1 sbim0 swrst1 swrst0 w 0 0 0 1 0 0 0 0 17bh (no rmw) i2c mode 0:slave 1:master 0:receive 1:transmit start/stop generation 0:stop 1:start intsbe1 interrupt 0:request 1:cancel operation mode selection 00:port mode 10:i2c mode 01:sio mode 11:reserved software reset generate write ?10? and ?01?, then an internal reset signal is generated. - - - - sbim1 sbim0 - - w w w - - - - 0 0 0 0 sbi1cr2 sbi1 control register 2 17bh (no rmw) sio mode operation mode selection 00:port mode 10:i2c mode 01:sio mode 11:reserved fix to ?00? mst trx bb pin al aas ad0 lrb r 0 0 0 1 0 0 0 0 17bh (no rmw) i2c mode 0:slave 1:master 0:receive 1:transmit bus status monitor 0:free 1:busy intsbe1in terrupt 0:request 1:cancel arbitration lost detection monitor 1:detect slave address match detection monitor 1:detect general call detection 1:detect last receive bit monitor 0: ?0? 1: ?1? - - - - siof sef - - r - - - - 0 0 - - sbi1sr sbi1 status register 17bh (no rmw) sio mode transfer status 0:stopped 1:in progress shift status 0:stopped 1:in progress
tmp92cd54i 2009-12-26 92cd54i-333 tentative symbol name address 7 6 5 4 3 2 1 0 bc2 bc1 bc0 ack sck3 sck2 sck1 swrmon/ sck0 w r/w w r/w 0 0 0 0 1 0 0 1/0 180h (no rmw) i2c mode number of transfer bits 000:8 001:1 010:2 011:3 100:4 101:5 110:6 111:7 acknowled ge mode 0:disable 1:enable setting of the divide value ?n? / fast / standard 0001: ? 0010: ? 0011: 8 0100: 9 0101: 10 0110:11 1000:fast 1111:standard other: reserved sios sioinh siom1 siom0 - sck2 sck1 sck0 w w w 0 0 0 0 1 0 0 0 sbi2cr1 sbi2 control register 1 180h (no rmw) sio mode transfer 0:stop 1:start transfer 0:continue 1:abort transfer mode 00:8bit transmit 10:8bit transmit/receive 11:8bit receive note) write 0 to this bit in sio mode. setting of the divide value ?n? 000:4 001:5 010:6 011:7 100:8 101:9 110:10 111:external clock sck2 rb7/tb7 rb6/tb6 rb5/tb5 rb4/tb4 rb3/tb3 rb2/tb2 rb1/tb1 rb0/tb0 r(receiving)/w(transmission) sbi2dbr sbi2 buffer register 181h (no rmw) undefine sa6 sa5 sa4 sa3 sa2 sa1 sa0 als w 0 0 0 0 0 0 0 0 i2c2ar i2cbus2 address register 182h (no rmw) setting slave address address recognition 0:enable 1:disable mst trx bb pin sbim1 sbim0 swrst1 swrst0 w 0 0 0 1 0 0 0 0 183h (no rmw) i2c mode 0:slave 1:master 0:receive 1:transmit start/stop generation 0:stop 1:start intsbe2 interrupt 0:request 1:cancel operation mode selection 00:port mode 10:i2c mode 01:sio mode 11:reserved software reset generate write ?10? and ?01?, then an internal reset signal is generated. - - - - sbim1 sbim0 - - w w w - - - - 0 0 0 0 sbi2cr2 sbi2 control register 2 183h (no rmw) sio mode operation mode selection 00:port mode 10:i2c mode 01:sio mode 11:reserved fix to ?00? mst trx bb pin al aas ad0 lrb r 0 0 0 1 0 0 0 0 183h (no rmw) i2c mode 0:slave 1:master 0:receive 1:transmit bus status monitor 0:free 1:busy intsbe2 interrupt 0:request 1:cancel arbitration lost detection monitor 1:detect slave address match detection monitor 1:detect general call detection 1:detect last receive bit monitor 0: ?0? 1: ?1? - - - - siof sef - - r - - - - 0 0 - - sbi2sr sbi2 status register 183h (no rmw) sio mode transfer status 0:stopped 1:in progress shift status 0:stopped 1:in progress
tmp92cd54i 2009-12-26 92cd54i-334 tentative symbol name address 7 6 5 4 3 2 1 0 - i2sbi0 - - - - - - w r/w 0 0 - - - - - - sbi0br0 sbi0 baud rate register 0 174h fix to ?0? idle2 0:abort 1:operate p4en - - - - - - - r / w 0 - - - - - - - sbi0br1 sbi0 baud rate register 1 175h baud rate control circuit 0:abort 1:operate - i2sbi0 - - - - - - w r/w 0 0 - - - - - - sbi1br0 sbi1 baud rate register 0 17ch fix to ?0? idle2 0:abort 1:operate p4en - - - - - - - r / w 0 - - - - - - - sbi1br1 sbi1 baud rate register 1 17dh baud rate control circuit 0:abort 1:operate - i2sbi0 - - - - - - w r/w 0 0 - - - - - - sbi2br0 sbi2 baud rate register 0 184h fix to ?0? idle2 0:abort 1:operate p4en - - - - - - - r / w 0 - - - - - - - sbi2br1 sbi2 baud rate register 1 185h baud rate control circuit 0:abort 1:operate
tmp92cd54i 2009-12-26 92cd54i-335 tentative (12) can controller (1/5) symbol name address 7 6 5 4 3 2 1 0 id23 id22 id21 id20 id19 id18 id17 id16 r/w mbnmi0l message identifier 0l mbn* + 00h (no rmw) - - - - - - - - ide game rfh id28 id27 id26 id25 id24 r/w mbnmi0h message identifier 0h mbn* + 01h (no rmw) - - - - - - - - id7 id6 id5 id4 id3 id2 id1 id0 r/w mbnmi1l message identifier 1l mbn* + 02h (no rmw) - - - - - - - - id15 id14 id13 id12 id11 id10 id9 id8 r/w mbnmi1h message identifier 1h mbn* + 03h (no rmw) - - - - - - - - - - - rtr dlc3 dlc2 dlc1 dlc0 r/w mbnmcfl message control field l mbn* + 04h (no rmw) - - - - - - - - - - - - - - - - mbnmcfh message control field h mbn* + 05h (no rmw) - - - - - - - - d07 d06 d05 d04 d03 d02 d01 d00 r/w mbnd0 data 0 mbn* + 06h (no rmw) - - - - - - - - d17 d16 d15 d14 d13 d12 d11 d10 r/w mbnd1 data 1 mbn* + 07h (no rmw) - - - - - - - - d27 d26 d25 d24 d23 d22 d21 d20 r/w mbnd2 data 2 mbn* + 08h (no rmw) - - - - - - - - d37 d36 d35 d34 d33 d32 d31 d30 r/w mbnd3 data 3 mbn* + 09h (no rmw) - - - - - - - - d47 d46 d45 d44 d43 d42 d41 d40 r/w mbnd4 data 4 mbn* + 0ah (no rmw) - - - - - - - - d57 d56 d55 d54 d53 d52 d51 d50 r/w mbnd5 data 5 mbn* + 0bh (no rmw) - - - - - - - - d67 d66 d65 d64 d63 d62 d61 d60 r/w mbnd6 data 6 mbn* + 0ch (no rmw) - - - - - - - - d77 d76 d75 d74 d73 d72 d71 d70 r/w mbnd7 data 7 mbn* + 0dh (no rmw) - - - - - - - - tsv7 tsv6 tsv5 tsv4 tsv3 tsv2 tsv1 tsv0 r mbntsvl time stamp value l mbn* + 0eh - - - - - - - - tsv15 tsv14 tsv13 tsv12 tsv11 tsv10 tsv9 tsv8 r mbntsvh time stamp value h mbn* + 0fh - - - - - - - - note: mbn = 200h + n 10h, n = 0 to 15
tmp92cd54i 2009-12-26 92cd54i-336 tentative can controller (2/5) symbol name address 7 6 5 4 3 2 1 0 mc7 mc6 mc5 mc4 mc3 mc2 mc1 mc0 r/w mcl mailbox configuration register l 300h 0 0 0 0 0 0 0 0 mc15 mc14 mc13 mc12 mc11 mc10 mc9 mc8 r/w mch mailbox configuration register h 301h 0 0 0 0 0 0 0 0 md7 md6 md5 md4 md3 md2 md1 md0 r/w mdl mailbox direction register l 302h 0 0 0 0 0 0 0 0 md15 md14 md13 md12 md11 md10 md9 md8 r r/w mdh mailbox direction register h 303h 1 0 0 0 0 0 0 0 trs7 trs6 trs5 trs4 trs3 trs2 trs1 trs0 r/s trsl transmission request se t register l 304h (no rmw) 0 0 0 0 0 0 0 0 - trs14 trs13 trs12 trs11 trs10 trs9 trs8 r/s trsh transmission request se t register h 305h (no rmw) - 0 0 0 0 0 0 0 trr7 trr6 trr5 trr4 trr3 trr2 trr1 trr0 r/s trrl transmission request reset register l 306h (no rmw) 0 0 0 0 0 0 0 0 - trr14 trr13 trr12 trr11 trr10 trr9 trr8 r/s trrh transmission request reset register h 307h (no rmw) - 0 0 0 0 0 0 0 ta7 ta6 ta5 ta4 ta3 ta2 ta1 ta0 r/c tal transmission acknowledge register l 308h (no rmw) 0 0 0 0 0 0 0 0 - ta14 ta13 ta12 ta11 ta10 ta9 ta8 r/c tah transmission acknowledge register h 309h (no rmw) - 0 0 0 0 0 0 0 aa7 aa6 aa5 aa4 aa3 aa2 aa1 aa0 r/c aal abort acknowledge register l 30ah (no rmw) 0 0 0 0 0 0 0 0 - aa14 aa13 aa12 aa11 aa10 aa9 aa8 r/c aah abort acknowledge register h 30bh (no rmw) - 0 0 0 0 0 0 0 rmp7 rmp6 rmp5 rmp4 rmp3 rmp2 rmp1 rmp0 r/c rmpl receive message pending register l 30ch (no rmw) 0 0 0 0 0 0 0 0 rmp15 rmp14 rmp13 rmp12 rmp11 rmp10 rmp9 rmp8 r/c rmph receive message pending register h 30dh (no rmw) 0 0 0 0 0 0 0 0 rml7 rml6 rml5 rml4 rml3 rml2 rml1 rml0 r rmll receive message los t register l 30eh 0 0 0 0 0 0 0 0 rml15 rml14 rml13 rml12 rml11 rml10 rml9 rml8 r rmlh receive message los t register h 30fh 0 0 0 0 0 0 0 0
tmp92cd54i 2009-12-26 92cd54i-337 tentative can controller (3/5) symbol name address 7 6 5 4 3 2 1 0 lam23 lam22 lam21 lam20 lam19 lam18 lam17 lam16 r/w lam0l local accept -ance mask register 0l 310h 0 0 0 0 0 0 0 0 lami - - lam28 lam27 lam26 lam25 lam24 r/w r/w lam0h local accept -ance mask register 0h 311h 0 - - 0 0 0 0 0 lam7 lam6 lam5 lam4 lam3 lam2 lam1 lam0 r/w lam1l local accept -ance mask register 1l 312h 0 0 0 0 0 0 0 0 lam15 lam14 lam13 lam12 lam11 lam10 lam9 lam8 r/w lam1h local accept -ance mask register 1h 313h 0 0 0 0 0 0 0 0 gam23 gam22 gam21 gam20 gam19 gam18 gam17 gam16 r/w gam0l global acceptance mask registe r 0l 314h 0 0 0 0 0 0 0 0 gami - - gam28 gam27 gam26 gam25 gam24 r/w r/w gam0h global acceptance mask registe r 0h 315h 0 - - 0 0 0 0 0 gam7 gam6 gam5 gam4 gam3 gam2 gam1 gam0 r/w gam1l global acceptance mask registe r 1l 316h 0 0 0 0 0 0 0 0 gam15 gam14 gam13 gam12 gam11 gam10 gam9 gam8 r/w gam1h global acceptance mask registe r 1h 317h 0 0 0 0 0 0 0 0 ccr smr hmr wuba mtos - tscc sres r/w w mcrl master contro l register l 318h 1 0 0 0 0 - 0 0 - - - - - - tstlb tsterr r / w mcrh master contro l register h 319h - - - - - - 0 0 cce sma hma - tso bo ep ew r r gsrl global statu s register l 31ah 1 0 0 - 0 0 0 0 msginslot<3:0> rm tm - - r gsrh global statu s register h 31bh 1 1 1 1 0 0 - - brp7 brp6 brp5 brp4 brp3 brp2 brp1 brp0 r/w bcr1l bit configuration register 1l 31ch 0 0 0 0 0 0 0 0 - - - - - - - - bcr1h bit configuration register 1h 31dh - - - - - - - - sam tseg22 tseg21 tseg20 tseg13 tseg12 tseg11 tseg10 r/w bcr2l bit configuration register 2l 31eh 0 0 0 0 0 0 0 0 - - - - - - sjw1 sjw0 r / w bcr2h bit configuration register 2h 31fh - - - - - 0 0
tmp92cd54i 2009-12-26 92cd54i-338 tentative can controller (4/5) symbol name address 7 6 5 4 3 2 1 0 rfpf wuif rmlif trmabf tsoif boif epif wlif r/c gifl global interrupt flag l 320h (no rmw) 0 0 0 0 0 0 0 0 - - - - - - - - gifh global interrupt flag h 321h (no rmw) - - - - - - - - rfpm wuim rmlim trmab m tsoim boim epim wlim r/w giml global interrupt mask l 322h 0 0 0 0 0 0 0 0 - - - - - - - - gimh global interrupt mask h 323h - - - - - - - - mbtif7 mbtif6 mbtif5 mbtif4 mb tif3 mbtif2 mbtif1 mbtif0 r/c mbtifl mailbox transmit int. flag l 324h (no rmw) 0 0 0 0 0 0 0 0 - mbtif14 mbtif13 mbtif12 mbtif11 mbtif10 mbtif9 mbtif8 r/c mbtifh mailbox transmit int. flag h 325h (no rmw) - 0 0 0 0 0 0 0 mbrif7 mbrif6 mbrif5 mbrif4 mbrif3 mbrif2 mbrif1 mbrif0 r/c mbrifl mailbox receive int. flag l 326h (no rmw) 0 0 0 0 0 0 0 0 mbrif15 mbrif14 mbrif13 mbrif12 mbrif11 mbrif10 mbrif9 mbrif8 r/c mbrifh mailbox receive int. flag h 327h (no rmw) 0 0 0 0 0 0 0 0 mbim7 mbim6 mbim5 mbim4 mbim3 mbim2 mbim1 mbim0 r/w mbiml mailbox interrupt flag l 328h 0 0 0 0 0 0 0 0 mbim15 mbim14 mbim13 mbim12 mbim11 mbim10 mbim9 mbim8 r/w mbimh mailbox interrupt flag h 329h 0 0 0 0 0 0 0 0 cdr7 cdr6 cdr5 cdr4 cdr3 cdr2 cdr1 cdr0 r/w cdrl change data request register l 32ah 0 0 0 0 0 0 0 0 - cdr14 cdr13 cdr12 cdr11 cdr10 cdr9 cdr8 r/w cdrh change data request register h 32bh - 0 0 0 0 0 0 0 rfp7 rfp6 rfp5 rfp4 rfp3 rfp2 rfp1 rfp0 r rfpl remote frame pending register l 32ch 0 0 0 0 0 0 0 0 rfp15 rfp14 rfp13 rfp12 rfp11 rfp10 rfp9 rfp8 r rfph remote frame pending register h 32dh - - - - - - - - rec7 rec6 rec5 rec4 rec3 rec2 rec1 rec0 r/w cecl can error counter l 32eh (no rmw) 0 0 0 0 0 0 0 0 tec7 tec6 tec5 tec4 tec3 tec2 tec1 tec0 r/w cech can error counter h 32fh (no rmw) 0 0 0 0 0 0 0 0
tmp92cd54i 2009-12-26 92cd54i-339 tentative can controller (5/5) symbol name address 7 6 5 4 3 2 1 0 - - - - tsp3 tsp2 tsp1 tsp0 r / w tspl time stamp prescaler l 330h - - - - 0 0 0 0 - - - - - - - - tsph time stamp prescaler h 331h - - - - - - - - tsc7 tsc6 tsc5 tsc4 tsc3 tsc2 tsc1 tsc0 r/w tscl time stamp counter l 332h (no rmw) 0 0 0 0 0 0 0 0 tsc15 tsc14 tsc13 tsc12 tsc11 tsc10 tsc9 tsc8 r/w tsch time stamp counter h 333h (no rmw) 0 0 0 0 0 0 0 0
tmp92cd54i 2009-12-26 92cd54i-340 tentative (13) rtc symbol name address 7 6 5 4 3 2 1 0 - - - - rtcsel2 rtcsel1 rtcsel0 rtcrun r/w r/w r/w 0 - - - 0 0 0 0 rtccr rtc control register 118h write to ?0? 1x0: 2 16 /fs 1x1: 2 15 /fs 00: 2 14 /fs 01: 2 13 /fs 10: 2 12 /fs 11: 2 11 /fs 0: stop & clear 1: run xtsel - - - - - - xten r / w r / w 0 - - - - - - 0 rtcfc rtc function control register 119h 0:crystal 1:cr low frequency oscillator (fs) 1:oscillation
tmp92cd54i 2009-12-26 92cd54i-341 tentative 6. port equivalent circuits ? circuit diagram convention basically, the circuit diagrams use the same gate symbols as those used for the 74hcxx standard cmos logic ic series. a special signal name is as follows: stop: this signal is activated (set to 1) when the cpu executes the halt instruction with stop mode specified in the halt mode setup register (clkmod = 0, 1). the stop signal, however, remains set to 0 if the driver enable bit, wdmod, is set to 1. ? input protection resistance is approximately several tens of ohms to several hundreds of ohms. p0 (d0 to d7), p4 (a0 to a7), p70, p71, p73 to p75, pc0 to pc5, pd0 to pd7, pf1(rxd0), pf2 (cts0, sclk0), pf4 (rxd1), pf5 ( cts1 , sclk1), pf6 (tx), pf7 (rx), pm0 ( ss ), pn0 (sck0), pn3 (sck1), pm4 (sck2) p72 (si2/scl2), pf0 (txd0), pf3 (txd1), pm1 (mosi), pm2 (miso), pm3 (seclk), pn1 (so0/sda0), pn2 (si0/scl0), pn4 (so1 /sda1), pn5 (si1/scl1), pn6 (so2/sda2) out p ut enable stop in p ut data in p ut enable i/o n-ch p-ch out p ut data vcc vcc n-ch p-ch in p ut data in p ut enable i/o n-ch p-ch vcc out p ut data stop o p en drain out p ut enable out p ut enable vcc n-ch p-ch
tmp92cd54i 2009-12-26 92cd54i-342 tentative pg(an0 to 7), pl0 to 3(an8 to 11) int0 reset in p ut data in p ut n-ch p-ch a nalo g in p ut channel select a nalo g in p ut in p ut enable vcc n-ch p-ch in p ut schmitt vcc 100 k ? t yp . reset wdtout reset enable vcc n-ch p-ch int0 input schmitt
tmp92cd54i 2009-12-26 92cd54i-343 tentative x1, x2 xt1, xt2 oscillation enable clock n-ch p-ch x2 x1 hi g h fre q uenc y oscillato r vcc vcc n-ch p-ch n-ch p-ch low frequency oscillation enable type of low frequency oscillation select 0:crystal 1:cr clock n-ch p-ch oscillato r xt2 xt1 vcc vcc n-ch p-ch n-ch p-ch
tmp92cd54i 2009-12-26 92cd54i-344 tentative vrefh, vrefl nmi p-ch vrefh vrefl strin g resistance vrefon vcc vcc n-ch p-ch n-ch p-ch nmi input schmitt
tmp92cd54i 2009-12-26 92cd54i-345 tentative clk am0 to 1, test0 to 1 in p ut data in p ut vcc vcc vcc p-ch n-ch out p ut clk out p ut enable internal reset p-ch vcc n-ch p-ch n-ch p-ch
tmp92cd54i 2009-12-26 92cd54i-346 tentative regout regen re g ulato r enable in p ut in p ut vcc vcc n-ch p-ch vcc p-ch output - + bgr regulator + bgr
tmp92cd54i 2009-12-26 92cd54i-347 tentative 7. handling precautions and restrictions (1) special representations and terms 1. description of built-in i/o re gister: register-symbol example: trun01 indicate s bit t0run in register trun. 2. read-modify-write instruction (rmw) a read-modify-write instruction is a single instruction executed by the cpu that reads data from a memory address, manipulates the data and then writes the data back to the same memory address. example 1: set 3, (trun01) ... se ts bit 3 in the trun01 register. example 2: inc 1, (100h) ... increment s data at address 100h by one. ? read-modify-write instructions in tlcs-900 exchange instruction ex (mem), r arithmetic instructions add (mem), r/# adc (mem), r/# sub (mem), r/# sbc (mem), r/# inc #3, (mem) dec #3, (mem) logical operation and (mem), r/# or (mem), r/# xor (mem), r/# bit manipulation stcf #3/a, (mem) res #3, (mem) set #3, (mem) chg #3, (mem) tset #3, (mem) xor (mem), r/# rotate and shift rlc (mem) rrc (mem) rl (mem) rr (mem) sla (mem) sra (mem) sll (mem) srl (mem) rld (mem) rrd (mem)
tmp92cd54i 2009-12-26 92cd54i-348 tentative (2) handling precautions and restrictions a) watchdog timer upon a reset, the watchdog timer is enabled. it should be disabled if it is not used for operation. b) clock settling time after an external reset is rele ased, the device waits during the settling time for the clock multiplier within the device before starting op eration. for details, see "3.1.2 reset." when the device is restored from stop standby mode with an interrupt, an oscillator settling time and other intervals are automatically inse rted before the internal circuitry starts operation. for details, see ? stop mode? in ?(3) operation in each mode? in section 3.4, ?standby controller.? c) undefined sfr bits undefined bits in special function registers (sfrs) return undefined values when read. the program should not depend on the states of those bits. d) reserved areas in address space the 16-byte space from fffff0h to ffffffh is reserved as an internal area and cannot be used. when an emulator is used, 64 kbytes of the 16-mbyte space are used to control the emulator and not available to the user. e) pop sr instruction the pop sr instruction should be executed in di (interrupt disabled) state.
tmp92cd54i 2009-12-26 92cd54i-349 tentative 8. package package dimensions lqfp100-p-1414-0.50f 75 76 51 50 26 100 25 1 14.0 0.2 16.0 0.2 1.0 typ 1.0 typ 14.0 0.2 16.0 0.2 0.2 0.1 0.5 0.08 m 15.0 0.2 1.85 max 1.4 0.2 0.08 0.5 0.2 0~10 0.125 +0.1 -0.05 unit : mm 0.1 +0.15 -0.1 note1: the drawings shown may not accurately represent the actual shape or dimensions.
tmp92cd54i 92cd54i-350 2009-12-26 tentative restrictions on product use ? toshiba corporation, and its subsidiaries and affiliates (collectively ?toshiba?), re serve the right to make changes to the in formation in this document, and related hardware, software and systems (collectively ?product?) without notice. ? this document and any information herein may not be reproduc ed without prior written permission from toshiba. even with toshiba?s written permission, reproduc tion is permissible only if reproducti on is without alteration/omission. ? though toshiba works continually to improve product's quality and reliability, product can malfunction or fail. customers are responsible for complying with safety standards and for prov iding adequate designs and safeguards for their hardware, software and systems which minimize risk and avoid situations in which a ma lfunction or failure of product could cause loss of human life, b odily injury or damage to property, including data loss or corruption. before customers use the product, create designs including the product, or incorporate the product into their own a pplications, customers must also refer to and comply with (a) the latest versions of all relevant toshiba information, including without limitation, this document, the specifications, the data sheets and application notes for product and the precautions and conditions set forth in the "toshiba se miconductor reliability handbook" and (b) the instructions for t he application with which the product will be used with or for. custom ers are solely responsible for all aspects of their own prod uct design or applications, including but not limited to (a) determining the appropriateness of the use of this product in such design or applications; (b) evaluating and determining the applicability of any information contained in th is document, or in charts, diagrams, program s, algorithms, sample application circuits, or any other referenced documents; and (c) validating all operating parameters for suc h designs and applications. toshiba assumes no liability for customers' product design or applications. ? product is intended for use in general el ectronics applications (e.g., computers, personal equipment, office equipment, measur ing equipment, industrial robots and home electr onics appliances) or for specif ic applications as expre ssly stated in this document . product is neither intended nor warranted for use in equipment or systems that require extraordinarily high levels of quality and/or re liability and/or a malfunction or failure of which may cause loss of hum an life, bodily injury, serious property damage or serious public impact (?unintended use?). unintended use includes, without limitation, e quipment used in nuclear facilities, equipment used in the ae rospace industry, medical equipment, equipment used for automobiles, tr ains, ships and other transportation, traffic signaling equipmen t, equipment used to control combustions or ex plosions, safety devices, elevators and esca lators, devices related to electric powe r, and equipment used in finance-related fields. do not use product for unintended use unle ss specifically permitted in this document. ? do not disassemble, analyze, reverse-engineer, alter, modify, translate or copy product, whether in whole or in part. ? product shall not be used for or incorporated into any products or systems whose manufacture, use, or sale is prohibited under any applicable laws or regulations. ? the information contained herein is pres ented only as guidance for product use. no re sponsibility is assumed by toshiba for an y infringement of patents or any other intellectual property rights of third parties that may result from the use of product. no license to any intellectual property right is granted by this document, w hether express or implied, by estoppel or otherwise. ? a bsent a written signed agreement, except as provid ed in the relevant terms and conditions of sale fo r product, and to the maximum extent allowable by law, toshiba (1) assumes no liability whatsoever, including without limitation, indirect, co nsequential, special, or incidental damages or loss, including without limitation, loss of profit s, loss of opportunities, business interruption and loss of data, and (2) disclaims any and all express or implied warranties and conditions related to sale, use of product, or information, including warranties or conditions of merchantability, fitness for a particular purpose, accuracy of information, or noninfringement. ? do not use or otherwise make available product or related so ftware or technology for any military purposes, including without limitation, for the design, development, use, stockpiling or manufacturing of nuclear, chemical, or biological weapons or missile technolog y products (mass destruction weapons). product and related softwa re and technology may be controlled under the japanese foreign exchange and foreign trade law and the u.s. export administration regulations. export and re-export of product or related softw are or technology are strictly prohibited except in compliance with all applicable export laws and regulations. ? please contact your toshiba sales representative for details as to environmental matters such as the rohs compatibility of pro duct. please use product in compliance with all applicable laws and regula tions that regulate the inclusion or use of controlled subs tances, including without limitation, the eu rohs directive. toshiba assumes no liability for damages or losses occurring as a result o f noncompliance with applicable laws and regulations.
  toshiba original cmos 32-bit microcontroller tlcs-900/h1 series TMP92CD54IFG tentative semiconductor company
preface thank you very much for making us e of toshiba microcomputer lsis. before use this lsi, refer the section, ?points of note and restrictions?.
tmp92cd54i 2009-12-26 92cd54i-1 tentative cmos 32-bit micro-controller TMP92CD54IFG 1. outline and device characteristics the tmp92cd54i is a high-performance 32-b it microcontroller incorporating a toshiba- proprietary cpu, the tlcs-900/h1 core. the tmp 92cd54i is deve loped for various automotive equipments which require high-speed data processing. housed in a 100-pin mini-flat package, the tm p92cd54i is best suited for high-density implementation of user systems. the characteristics of the tmp92cd54i are listed below: (1) toshiba-proprietary high-speed 32-bit cpu (tlcs-900/h1 cpu) fully-compatible with the instruction codes of the tlcs-900, tlcs-900/l, elcs-900/l1, tlcs-900/h and tlcs-900/h2 16 mbytes of linear address space general-purpose registers and register banks micro dma: 8 channels (250 ns/4 bytes at fc = 20 mhz) minimum instruction execution time: 50 ns (at fc = 20 mhz) internal data bus: 32-bit wide (2) internal memory internal ram : 32k-byte (32 bit/one clock ac cess time, can be used for instructions. internal rom : 512k-byte mask rom (3) external memory expansion expandable up to 16-mbyte (for code and data) external data bus: 8-bit wide (the upper addr ess bus is not available when the built-in i/os are selected.) (4) memory controller (memc) chip select output: 1 channel (5) 8-bit timer : 8 channels 8-bit interval timer mode (8 channels) 16-bit interval timer mode (4 channels) 8-bit programmable pulse generation (ppg) output mode (4 channels) 8-bit pulse width modulation (pwm) output mode (4 channels) (6) 16-bit timer : 2 channels 16-bit interval timer mode (2 channels) 16-bit event counter mode (2 channels) 16-bit programmable pulse generation (ppg) output mode (2 channels) frequency measurement mode pulse width measurement mode time difference measurement mode (7) serial interface (sio) : 2 channels i/o interface mode universal asynchronous receiver transmitter (uart) mode (8) serial expansion interface (sei) : 1 channel baud rate 4m / 2m / 500kbps at fc = 20mhz. (9) serial bus interface (sbi) : 3 channels clock-synchronous 8-bit serial interface mode i 2 c bus mode
tmp92cd54i 2009-12-26 92cd54i-2 tentative (10) can controller : 1 channel supports can version 2.0b. 16 mailboxes (11) 10-bit a/d converter (adc) : 12 channels a/d conversion time: 8 sec (at fc = 20 mhz) total tolerance: 3 lsb (excluding quantization error) scan mode for all 12 channels (12) watch dog timer (wdt) (13) timer for real-time clock (rtc) can operate with low-frequency oscillator only. (14) interrupt controller (intc) : 60 interrupt sources 9 interrupts from cpu (software interrupts and undefined instruction interrupt) 42 internal interrupt vectors 9 external interrupt vectors (int0 to int7, nmi ) (15) i/o port : 68 pins (16) standby mode four modes: idle3, idle2, idle1 and stop stop mode can be released by 9 external inputs. (17) internal voltage detection flag (ramstb) (18) power supply voltage v cc5 = 4.5 v to 5.25 v v cc3 = 3.3 v (connect regout (built-in vo ltage regulator output) to dvcc3.) (19) operating temperature : -40 to 85 degree c (20) package : lqfp100-p-1414-0.50f
tmp92cd54i 2009-12-26 92cd54i-3 tentative figure 1.1 tmp92cd54i block diagram pm0( ss /a8) pm1(mosi/a9) pm2(miso/a10) pm3(seclk/a11) pn0(sck0) pn1(so0/sda0) pn2(si0/scl0) pn3(sck1/a12) pn4(so1/sda1/a13) pn5(si1/scl1/a14) p00 to p07(d0 to d7) p40 to p47(a0 to a7) p70( rd ) p71( wr ) p73( cs ) p74 p75( wait ) dvss [6] dvcc5 [5] regen dvcc3 [3] connect port 0 port 4 interrupt controller serial bus i/f channel 0 serial bus i/f channel 1 serial exp. i/f int0 port 7 32kb ram 512kb mask rom serial i/o channel 0 serial i/o channel 1 10-bit 12ch a/d converter 32 bits xsp xiz xiy xix xhl xde xbc xwa ix iy iz sp l h e d c b a w f sr p c 900/h1 cpu watch-dog timer real time clock (rtc) (to7/int4)pc5 8-bit timer (timer0) 8-bit timer (timer1) 8-bit timer (timer2) 8-bit timer (timer3) 8-bit timer (timer4) 8-bit timer (timer5) 8-bit timer (timer6) 8-bit timer (timer7) (ti4/int3)pc3 (to3/int2)pc2 (to5)pc4 (ti0/int1)pc0 (to1)pc1 can controller (tx)pf6 (rx)pf7 vrefl vrefh advss advcc pg0 to pg7 (an0 to an7) pl0 to pl3 (an8 to an11) regout xt1 xt2 x1 x2 serial bus i/f channel 2 pm4(sck2) pn6(so2/sda2/a15) p72(si2/scl2) nmi a m0 a m1 test0 test1 reset (sclk0/ cts0 )pf2 (rxd0)pf1 (txd0)pf0 (sclk1/ cts1 )pf5 (rxd1)pf4 (txd1)pf3 (ti9/wuint1/int6/a17)pd1 (ti8/wuint0/int5/a16)pd0 (to8/wuint2/a18)pd2 (to9/wuint3/a19)pd3 (tia/wuint4/int7/a20)pd4 (tib/wuint5/a21)pd5 (toa/wuint6/a22)pd6 (tob/wuint7/a23)pd7 16-bit timer (timer8) 16-bit timer (timera) osc rtc regulator clk
tmp92cd54i 2009-12-26 92cd54i-4 tentative 2. pin assignment and functions 2.1 pin assignment figure 2.1 tmp92cd54i pin assignment dvcc5 x1 dvss x2 test1 xt1 xt2 dvcc3 pn6/so2/sda2/a15 pn5/si1/scl1/a14 pn4/so1/sda1/a13 pn3/sck1/a12 dvss pn2/si0/scl0 dvcc5 pn1/so0/sda0 pn0/sck0 pc0/ti0/int1 pc1/to1 pc2/to3/int2 pc3/ti4/int3 pc4/to5 pc5/to7/int4 regen dvss pl3/an11 pl2/an10 pl1/an9 pl0/an8 pg7/an7 pg6/an6 pg5/an5 pg4/an4 pg3/an3 pg2/an2 pg1/an1 pg0/an0 dvss p75/wait dvcc3 p74 p73/cs p72/si2/scl2 p71/wr p70/rd am0 reset am1 clk test0 TMP92CD54IFG (lqfp100-p-1414-0.50f) 14 14 1.4 top view 01 05 10 15 20 25 75 70 65 60 55 51 50 45 40 35 30 26 076 080 085 090 095 d6/p06 d7/p07 a0/p40 a1/p41 a2/p42 a3/p43 a4/p44 a5/p45 a6/p46 a7/p47 dvcc3 int0 dvss nmi dvcc5 a16/wuint0/int5/ti8/pd0 a17/wuint1/int6/ti9/pd1 a18/wuint2/to8/pd2 a19/wuint3/to9/pd3 a20/wuint4/int7/tia/pd4 a21/wuint5/tib/pd5 a22/wuint6/toa/pd6 a23/wuint7/tob/pd7 regout dvcc5 100 advss advcc vrefl vrefh rx/pf7 tx/pf6 cts1/sclk1/pf5 rxd1/pf4 txd1/pf3 cts0/sclk0/pf2 rxd0/pf1 txd0/pf0 dvss pm4/sck2 dvcc5 a8/ss/pm0 a9/mosi/pm1 a10/miso/pm2 a11/seclk/pm3 d0/p00 d1/p01 d2/p02 d3/p03 d4/p04 d5/p05
tmp92cd54i 2009-12-26 92cd54i-5 tentative 2.2 pin names and functions the names and functions of the input/output pins are described in are described in the tables 2.2.1 to 2.2.4. table 2.2.1 input/output pins (1/4) pin name pin number number of pins in/out function (cmos) p00 to p07 d0 to d7 20 to 27 8 (ttl) in/out in/out port 0: i/o port. input or output specifiable in units of bits. data: data bus 0 to 7. p40 to p47 a0 to a7 28 to 35 8 in/out out port4: i/o port. input or output specifiable in units of bits. address: address bus 0 to 7. p70 rd 81 1 in/out out port70: i/o port. read: outputs strobe signal to read external memory. p71 wr 82 1 in/out out port 71: i/o port. write: output strobe signal to write external memory. p72 si2 scl2 83 1 in/out port 72: i/o port. sbi channel 2: input data at sio mode sbi channel 2: clock input/output at i2c mode p73 cs 84 1 in/out out port 73: i/o port. chip select: outputs ?low? if address is within specified address area. p74 85 1 in/out port 74: i/o port. p75 wait 87 1 in/out in port 75: i/o port. wait: signal used to request cpu bus wait. pc0 ti0 int1 58 1 in/out in in port c0: i/o port. timer input 0: input pin for timer 0. interrupt request pin 1: rising-edge interrupt request pin. pc1 to1 57 1 in/out out port c1: i/o port. timer output 1: output pin for timer 1. pc2 to3 int2 56 1 in/out out in port c2: i/o port. timer output 3: output pin for timer 3. interrupt request pin 2: rising-edge interrupt request pin. pc3 ti4 int3 55 1 in/out in in port c3: i/o port. timer input 4: input pin for timer 4. interrupt request pin 3: rising-edge interrupt request pin. pc4 to5 54 1 in/out out port c4: i/o port. timer output 5: output pin for timer 5. pc5 to7 int4 53 1 in/out out in port c5: i/o port. timer output 7: output pin for timer 7. interrupt request pin 4: rising-edge interrupt request pin. pd0 ti8 int5 a16 wuint0 41 1 in/out in in out in port d0: i/o port. timer input 8: input pin for timer 8. interrupt request pin 5: interrupt reques t pin with programmable rising/falling edge. address: address bus 16. wake up input 0: wake up request pin with programmable rising, falling or both falling and rising edge. pd1 ti9 int6 a17 wuint1 42 1 in/out in in out in port d1: i/o port. timer input 9: input pin for timer 9. interrupt request pin 6: rising-edge interrupt request pin. address: address bus 17. wake up input 1: wake up request pin with programmable rising, falling or both falling and rising edge. pd2 to8 a18 wuint2 43 1 in/out out out in port d2: i/o port. timer output 8: output pin for timer 8 address: address bus 18. wake up input 2: wake up request pin with programmable rising, falling or both falling and rising edge. wuint2 wuint0 wuint1 int6 int1 int2 int3 int4 int5
tmp92cd54i 2009-12-26 92cd54i-6 tentative table 2.2.2 input/output pins (2/4) pin name pin number number of pins in/out function pd3 to9 a19 wuint3 44 1 in/out out out in port d3: i/o port. timer output 9: output pin for timer 9 address: address bus 19. wake up input 3: wake up request pin with programmable rising, falling or both falling and rising edge. pd4 tia int7 a20 wuint4 45 1 in/out in in out in port d4: i/o port. timer input a: input pin for timer a interrupt request pin 7: interrupt request pin with programmable rising/falling edge. address: address bus 20. wake up input 4: wake up request pin with programmable rising, falling or both falling and rising edge. pd5 tib a21 wuint5 46 1 in/out in out in port d5: i/o port. timer input b: input pin for timer b. address: address bus 21. wake up input 5: wake up request pin with programmable rising, falling or both falling and rising edge. pd6 toa a22 wuint6 47 1 in/out out out in port d6: i/o port. timer output a: output pin for timer a. address: address bus 22. wake up input 6: wake up request pin with programmable rising, falling or both falling and rising edge. pd7 tob a23 wuint7 48 1 in/out out out in port d7: i/o port. timer output b: output pin for timer b. address: address bus 23. wake up input 7: wake up request pin with programmable rising, falling or both falling and rising edge. pf0 txd0 12 1 in/out out port f0: i/o port. serial interface channel 0: transmission data. pf1 rxd0 11 1 in/out in port f1: i/o port. serial interface channel 0: receive data. pf2 sclk0 cts0 10 1 in/out in/out in port f2: i/o port. serial interface channel 0: clock input/output. serial interface channel 0: data ready to send. (clear-to-send) pf3 txd1 9 1 in/out out port f3: i/o port. serial interface channel 1: transmission data. pf4 rxd1 8 1 in/out in port f4: i/o port. serial interface channel 1: receive data. pf5 sclk1 cts1 7 1 in/out in/out in port f5: i/o port. serial interface channel 1: clock input/output. serial interface channel 1: data ready to send. (clear-to-send) pf6 tx 6 1 in/out out port f6: i/o port. can: transmission data. pf7 rx 5 1 in/out in port f7: i/o port. can: receive data. pg0 to pg7 an0 to an7 89 to 96 8 in in port g: input-only port. analog input 0 to 7: ad converter input pins. pl0 to pl3 an8 to an11 97 to 100 4 in in port l0 to l3: input-only port. analog input 8 to 11: ad converter input pins. pm0 ss a8 16 1 in/out in out port m0: i/o port. sei: slave select input. address: address bus 8. pm1 mosi a9 17 1 in/out in/out out port m1: i/o port. sei: master output, slave input. address: address bus 9. wuint7 wuint6 wuint5 wuint4 int7 wuint3
tmp92cd54i 2009-12-26 92cd54i-7 tentative table 2.2.3 input/output pins (3/4) pin name pin number number of pins in/out function pm2 miso a10 18 1 in/out in/out out port m2: i/o port. sei: master input, slave output. address: address bus 10. pm3 seclk a11 19 1 in/out in/out out port m3: i/o port. sei: clock input/output. address: address bus 11. pm4 sck2 14 1 in/out in/out port m4: i/o port. sbi channel 2: clock input/output at sio mode. pn0 sck0 59 1 in/out in/out port n0: i/o port. sbi channel 0: clock input/output at sio mode. pn1 so0 sda0 60 1 in/out out in/out port n1: i/o port. sbi channel 0: output data input/output at sio mode sbi channel 0: data input/output at i2c mode pn2 si0 scl0 62 1 in/out in in/out port n2: i/o port. sbi channel 0: input data at sio mode sbi channel 0: clock input/output at i2c mode pn3 sck1 a12 64 1 in/out in/out out port n3: i/o port. sbi channel 1: clock input/output at sio mode address: address bus 12. pn4 so1 sda1 a13 65 1 in/out out in/out out port n4: i/o port. sbi channel 1: output data at sio mode sbi channel 1: data input/output at i2c mode address: address bus 13. pn5 si1 scl1 a14 66 1 in/out in in/out out port n5: i/o port. sbi channel 1: input data at sio mode sbi channel 1: clock input/output at i2c mode address: address bus 14 pn6 so2 sda2 a15 67 1 in/out out port n6: i/o port. sbi channel 2: output data at sio mode sbi channel 2: data input output at i2c mode address: address bus 15. nmi 39 1 in non-maskable interrupt: interrupt request pin with programmable falling or both falling and rising edge. int0 37 1 in interrupt request pin 0: interrupt request pin with programmable level or rising-edge. am0,1 80, 78 2 in address mode selection: connect am0 pin to l and am1 pin to h for single chip mode. test0,1 76, 71 2 in test mode pins: should be tied to gnd. clk 77 1 out programmable clock output (with pull-up resistor) x1/x2 74, 72 2 in/out high-frequency oscillator connecting pins: to dr ive these pins with an external clock, apply clock signals of 3.3 v. xt1/xt2 70, 69 2 in/out low-frequency oscillator connecting pins: to dr ive these pins with an external clock, apply clock signals of 3.3 v. reset 79 1 in reset: initializes lsi (with pull-up resistor). vrefh 4 1 in ad reference voltage high vrefl 3 1 in ad reference voltage low advcc 2 1 - power supply pin for ad converter (+5v): connect the advcc pin to 5-v power supply. advss 1 1 - gnd pin for ad converter: connect the advss pin to gnd (0v). nmi int0
tmp92cd54i 2009-12-26 92cd54i-8 tentative table 2.2.4 input/output pins (4/4) pin name pin number number of pins in/out function dvcc5 15, 40, 50, 61, 75 5 - power supply pins (+5v): c onnect all the dvcc5 pins to 5-v power supply. dvcc3 36, 68, 86 3 - power supply pins (+3.3v): connect all the dvcc3 pins to regout pin. dvss 13, 38, 51, 63, 73, 88 6 - gnd: connect all dvss pins to gnd (0v). regout 49 1 out regulator output 3.3v: connect capacitor to stabilize the regulator output. regen 52 1 in regulator enable pin: should be set to h or open (with pull-up resistor).
tmp92cd54i 2009-12-26 92cd54i-9 tentative 3. operation this section describes the basic functions and oper ations of the tmp92cd54i for each functional block. 3.1 cpu the tmp92cd54i incorporates a high-performan ce, high-speed 32-bit cpu, the tlcs-900/h1. 3.1.1 cpu overview the tlcs-900/h1 is a high-performance, high-speed cpu based on the tlcs-900/l1 and has a built-in data bus extended to 32 bits to enable faster processing. table 3.1.1 shows an overview of the cpu built into the tmp92cd54i.: table 3.1.1 cpu overview properties tlcs-900/h1 width of cpu address bus 24 bit width of cpu data bus 32 bit internal operating frequency 16 to 20mhz (f osc = 8 to 10mhz) minimum bus cycle (internal ram) 1 clock access (50ns @ f osc = 10mhz) internal ram 32 bit 1 clock access internal rom 32 bit interleave 2-1-1-1 clock access 8/16 bit 2 clock access port, intc, memc internal i/o 8/16 bit 5 to 6 clock access sei, sio, wdt, 8 bit timer, 16 bit timer, rtc, 10-bit adc, sbi, can external device 8 bit 2 clock access (can insert wait cycles) minimum instruction execution cycle 1 clock (50ns at f osc = 10mhz) conditional jump 2 clock (100ns at f osc = 10mhz) instruction queue buffer 12 byte instruction set compatible with tlcs-900, 900/h, 900/l, 900/l1 and 900/h2 (normal, min, max and ldx instructions are not supported) micro dma 8 channels
tmp92cd54i 2009-12-26 92cd54i-10 tentative 3.1.2 reset to apply a reset to the tmp92cd54i, drive the reset input pin low for at least 4 s (when f osc = 10 mhz) when the internal oscillator and clock multiplier are operating stably with the supply voltage in the normal operating range. the clock multiplier is bypassed during the reset period so that the system clock frequency, f c , becomes 5 mhz (when f osc = 10 mhz). when a reset is accepted, the cpu operates as follows: ? sets the program counter (pc) as follows in accordance with the reset vector stored at address ffff00h to ffff02h: pc<0 to 7> data in location ffff00h pc<8 to 15> data in location ffff01h pc<16 to 23> data in location ffff02h ? sets the stack pointer (xsp) to 00000000h. ? sets bits of the status regist er (sr) to 111 (thereby setting the interrupt level mask register to level 7). ? clears bits of the status regist er to 00 (thereby selecting register bank 0). when a reset is released, the cpu starts fetching and executing instructions according to the program counter (pc). the registers within the cpu other than those shown above remain unchanged. a reset being accepted also causes the built-in i/o, input/output port and other pins to be initialized as follows: ? initializes the internal i/o registers as table of ?special function register? in section 5. ? sets the port pins, including the pins that also act as internal i/o, to general-purpose input or output port mode. when the reset input pin is driven high, the built-in clock multiplier starts operating and the internal reset is released after the setting time for the circuit (1.6384 ms when f osc = 10mhz) elapses. upon a power-on reset, the control signals for the memory controller are unstable, possibly resulting in backup data being rewritten in external ram connected to the tmp92cd54i. when the reset input pin goes low, the input/output ports are initialized to input mode and the clkout pin output setting is initialized to high-z output. the clkout pin outputs high because it is pulled up within the device. since the pull-up circuit operates on the dvcc3 supply, however, the internal transistor on/off operation is not stable while the dvcc3 supply is rising, resulting in either a high-z or high (pulled up) output.
tmp92cd54i 2009-12-26 92cd54i-11 tentative 3.1.3 selecting a startup mode set test0 and test1 to gnd, am0 to low and am1 to high to select single-chip mode. . table 3.1.2 operation mode setup mode setup input pin operation mode reset am1 am0 test1 test0 single-chip mode h l l l
tmp92cd54i 2009-12-26 92cd54i-12 tentative 3.2 memory map figure 3.2.1 shows a memory map of the tmp92cd541i. 000000h 000400h 16mbyte area (r) ( ? r) (r + ) (r + r8/16) (r + d8/16) (nnn) direct area (n) 64kbyte area (nn) 512 kbyte internal rom internal i/o (1 kbyte)  internal ram (32 kbyte) 008400h 010000h f80000h ( = internal area) ffff00h ffffffh vector table (256 byte) external memory 000100h emulator control area (64k byte) figure 3.2.1 memory map note 1: when an emulator is used, 64 kbytes of the 16-mbyte space are used to control the emulator and not available to the user. note 2: accessing the emulator control space causes the wr and rd signals to be output. this should be taken into account when using expanded memory. note 3: the last 16 bytes (addresses fffff0h to ffffffh) in the vector table are reserved as internal space and cannot be used. note 4: if memory devices having different bus widths are located at contiguous addresses, any access spanning those devices should not be executed with a single in struction. such an attempt may prevent data from being read or written normally. ( note1 ) (note2)
tmp92cd54i 2009-12-26 92cd54i-13 tentative 3.3 clock function and standby functions 3.3.1 system clock block diagram figure 3.3.1 block diagram of system clock 10mhz 2/5 sei 16mhz system clock ?fc? clock doubler (pll) 4 (40mhz) 10mhz (10mhz) high frequency osc 20mhz 1/2 cpu memc intc romc port can sio timer wdt sbi a/d rtc x2 x1 for rtc 14-sta g e binar y counte r 32.768 khz (32.768 khz) ?fs? xt2 xt1 low frequency osc to generate the external memory interface timing 1/2
tmp92cd54i 2009-12-26 92cd54i-14 tentative 3.3.2 standby controller (1) halt mode executing the halt instruction (stop instruction) sets the operating mode to any of idle2, idle1, idle3 and stop depending on the setting of clkmod. clock mode register 7 6 5 4 3 2 1 0 bit symbol haltm1 haltm0 - - - clkoe clkm1 clkm0 read/write r/w r/w r/w after reset 1 1 - 0 - 0 0 0 function halt mode 00: idle3 01: stop 10: idle1 11: idle2 fix to ?0? clkoutput enable 0: not output 1: output clk output select 00: fc 01: reserved 10: 2/5 fc 11: reserved clk output clock select 00 fc 01 reserved 10 2/5 fc 11 reserved clk output enable 0 no output (high-z, pulled up) 1 output selects standby mode by halt instruction 00 idle3 01 stop 10 idle1 11 idle2 figure 3.3.2 clock mode register clkmod ( 010ah )
tmp92cd54i 2009-12-26 92cd54i-15 tentative the following shows whether individual blocks operate or stop in each mode: 1. idle2 mode: only the cpu is stopped. each built-in i/o block has a bit that controls whether it operates or stops in idle2 mode. the bits shown in table 3.3.1 are used to co ntrol the operation of built-in i/o blocks. table 3.3.1 the registers to control operation during idle2 mode internal i/o sfr registers timer0,timer1 trun01 timer2,timer3 trun23 timer4,timer5 trun45 timer6,timer7 trun67 timer8 trun8 timera truna sio0 sc0mod1 sio1 sc1mod1 sbi0 sbi0br0 sbi1 sbi1br0 sbi2 sbi2br0 a/d converter admod1 wdt wdmod 2. idle1 mode: only the low-speed oscillator and high-speed oscillator operate. 3. idle3 mode: only the low-speed oscillator and rtc operate. 4. stop mode: all internal circuits are stopped. table 3.3.2 shows which blocks operate and stop during halt mode. table 3.3.2 i/o operation during halt modes halt mode idle2 idle1 idle3 stop clkmod 11 10 00 01 cpu halt i/o ports hold the same state since the halt instruction was executed. see table 3.3.5 8-bit tmr, 16-bit tmr sio, sbi a/d converter wdt selectable see table 3.3.1 stop rtc, xt1 can, sei block interrupt controller operational
tmp92cd54i 2009-12-26 92cd54i-16 tentative (2) releasing a halt mode a halt mode can be released with a reset or an interrupt request. available halt release sources depend on the state of the interrupt mask register and the halt mode. table 3.3.3 shows details. ? release using an interrupt request whether a halt state is released with an inte rrupt request depends on the interrupt enable status. if the interrupt request level set before the execution of the halt instruction is greater than or equal to the value stored in the interrupt mask register, the halt mode is released, followed by interrupt handling for that interrupt source, after which processing is started from the instruction next to the halt instruction. if the interrupt request level is lower than the value in the interrupt mask register, the halt mode is not released (a nonmaskable interrupt, however, always causes th e halt mode to be released and the interrupt to be handled, regardless of the mask register value). only an int0 interrupt, however, releases the ha lt mode even if the interrupt request level is lower than the value in the interrupt mask register. in that case, interrupt handling is not performed and processing is started from the instruction next to the halt instruction (the int0 interrupt request flag maintains the value of "1"). ? release with a reset a reset causes all halt modes to be released. to release stop or idle3 mode, however, it requires a sufficient reset time (10 ms or longer when f osc = 10 mhz) for the internal oscillator to operate stably. when a halt mode is released with a reset, the data in built-in ram can hold the values it had immediately before entering the halt state but other settings are initialized (a release with an interrupt allows both ram data and other settings to maintain their pre-halt values). 
tmp92cd54i 2009-12-26 92cd54i-17 tentative table 3.3.3 source of halt state cl earance and halt clearance operation status of received interrupt interrupt enabled (interrupt level) (interrupt mask) interrupt disabled (interrupt level) < (interrupt mask) halt mode idle2 idle1 idle3 stop idle2 idle1 idle3 stop nmi intwdt     *1  *1 ? ? ? ? ? ? ? ? int0    *1 *2  *1 *2 { { { *1 *2 { *1 *2 int0 [mask] { { { *1 *2 { *1 *2 { { { *1 *2 { *1 *2 int1 to 7 intt0 to 7 inttr8 to b intto8, inttoa intrx0 to 1, tx0 to 1 intcr0, intct0, intcg0 intsem0, e0, r0, t0 intsbe0, s0, e1, s1, e2, s2 intad          all the above-mentioned interrupts [mask] intrtc    *1 { { { *1 interrupt source intrtc [mask] { { { *1 { { { *1 source of halt state clearance reset          : upon release from a halt, the cpu starts handling the interrupt (reset causes the device to be initialized). { : upon release from a halt, the cpu starts processing from the instruction next to the halt instruction. : cannot be used to release a halt. ? : these combinations are not available because the in terrupt priority level (interrupt request level) for nonmaskable interrupts is fixed to 7 (top priority). *1: a halt is released after a warm-up time elapses. *2: any wuint interrupt (wuint0 to 7) causes an int0 interrupt to occur. note 1: to release a halt using a level-mode int0 interrupt in the interrupt-enabl ed state, hold it high until interrupt handling starts. if it is driven low before interrupt handling starts, the interrupt cannot be handled normally. note 2: when using an int5 to int7 external interrupt in idle2 mode, set trun8 and truna to 1.  (example - clearing idle1 mode) an int0 interrupt in edge mode is used to release a halt in idle1 mode. address 8203h ld (iimc ), 00h ; selects int0 interrupt rising edge. 8206h ld (inte0ad), 06h ; sets int 0 interrupt level to 6. 8209h ei 5 ; sets the cpu interrupt mask register to 5. 820bh ld (clkmod), 80h ; sets h alt mode to idle1 mode. 820eh halt ; halts cpu. int0 int0 interrupt routine reti 820fh ld xx, xx
tmp92cd54i 2009-12-26 92cd54i-18 tentative (3) operation in each mode 1. idle2 mode in idle2 mode, the system clock is supplied only to the built-in i/o blocks specified with the built-in i/o operation control bits and the cpu stops executing instructions. figure 3.3.3 shows an example timing for releasing a halt state using an interrup. n e x t n e x t + 4 fc a0 to 23 rd wr d0 to 31 data data halt instruction execution sequence clearing interrup t interrupt response se q uence figure 3.3.3 timing chart for idle2 mode halt state cleared by interrupt 2. idle1 mode in idle1 mode, only the internal oscillator operates with the system clock for the cpu stopped. in the halt state, interrupt request sampling is performed asynchronously to the system clock. the halt state is, however, released in sync with the system clock. figure 3.3.4 shows an example timing for releasing a halt state using an interrupt. n e x t n e x t + 4 fc a0 to 23 rd wr d0 to 31 data data halt instruction execution sequence clearing interrup t interrupt response se q uence figure 3.3.4 timing chart for idle1 mode halt state cleared by interrupt internal signals internal signals
tmp92cd54i 2009-12-26 92cd54i-19 tentative 3. idle3 mode in idle3 mode, all internal circuits other than the low-speed oscillator and rtc, including the high-speed oscillator, are stopped. the pin states in idle3 mode depends on the setting of wdmod. table 3.3.5 shows th e states of pins in idle3 mode. the halt state in idle3 mode can be released with an external interrupt using the nmi , int0, or wuint0 to 7 pin (int0 interrupt), an internal interrupt using intrtc, or a reset. upon released from the halt state, the system clock output starts after the high-speed oscillator warm-up time and clock multiplier settling time elapse. the warm-up time for the high-speed oscillator is counted using the warm-up counter within the tmp92cd54i. once that counting ends, the device starts counting the settling time for the clock multiplier. this mechanism results in the high-speed oscillator warm-up time (1.6 ms) being included in the time requir ed between the halt release signal being input and the system clock being output even in a system using an external oscillator that does not need oscillation settling time. when using a reset to release a halt, ensure that the reset signal is held low until the high-speed oscillator operates stably. figure 3.3.5 shows an example timing for releasing a halt state using an interrupt. figure 3.3.5 timing chart for idle3 mode halt state cleared by interrupt fc (note) next next + 4 a0 to 23 rd wr d0 to 31 data data halt instruction execution sequence clearing interrupt interrupt response sequence fs(32khz) rtc operated operated programmable programmable internal signals (note); once the halt state is released, interrupt handling starts after the oscillator startup time (t sta ), warm-up time (approx. 1.6 ms) and clock multiplier settling time (approx. 1.6 ms) elapse. for details of the startup time (t sta ), contact the oscillator manufacturer. .
tmp92cd54i 2009-12-26 92cd54i-20 tentative 4. stop mode in stop mode, all internal circuits are stopped. the pin states in stop mode depends on the setting of wdmod. table 3.3.5 shows the states of pins in stop mode. the halt state in stop mode can be released with an external interrupt using the nmi , int0, or wuint0 to 7 pin (int0 interrupt) or a reset. upon released from the halt state, the system clock output starts after the high-speed oscillator warm-up time and clock multiplier settling time elapse. the warm-up time for the high-speed oscillator is counted using the warm-up counter within the tmp92cd54i. once that counting ends, the device starts counting the settling time for the clock multiplier. this mechanism results in the high-speed oscillator warm-up time (1.6 ms) being included in the time requir ed between the halt release signal being input and the system clock being output even in a system using an external oscillator that does not need oscillation settling time. when using a reset to release a halt, ensure that the reset signal is held low until the high-speed oscillator operates stably. in stop mode, the value of the rtcfc register is initialized even if the halt is released with an interrupt. it is, therefore, necessary to re-set rtcfc after releasing the halt. . n e x t n e x t + 4 fc a0 to 23 rd wr d0 to 31 data data halt instruction execution sequence clearing interrup t interrupt response se q uence (note) figure 3.3.6 timing chart for stop mode halt state cleared by interrupt table 3.3.4 warming-up time and clock doubler stable time after clearance of stop mode and idle3 mode (@ fc=20mhz) warm-up time 1.6 ms (2 14 /f osc ) clock doubler stable time 1.6 ms (2 14 /f osc ) fc = 2 f osc internal signals (note); once the halt state is released, interrupt handling starts after the oscillator startup time (t sta ), warm-up time (approx. 1.6 ms) and clock multiplier settling time (approx. 1.6 ms) elapse. for details of the startup time (t sta ), contact the oscillator manufacturer. .
tmp92cd54i 2009-12-26 92cd54i-21 tentative table 3.3.5 pin states in idle3 and stop mode pin names i/o = 0 = 1 input mode invalid output mode output p00 to 07 d0 to d7 high-z input mode invalid p40 to 47/a0 to 7 output mode high-z output input mode invalid p70,p71,p73 to 75/ rd , wr , cs to wait output mode high-z output input mode input p72/si2/scl2 output mode input output input mode invalid pc0 to pc5/ti0 to to7 output mode high-z output input mode input output mode high-z output pd0 to pd7/ti8 to tob wuint0 to 7 input input mode invalid pf0 to pf7/txd0 to rx output mode high-z output pg0 to pg7/an0 to an7 input mode invalid pl0 to pl3/an8 to an11 input mode invalid input mode invalid pm0 to pm4 / ss to sck2 output mode high-z output input mode invalid pn0 to pn6 /sck0 to so2&sda2 output mode high-z output nmi input input int0 input input reset input input am0, am1 input input test0, test1 input input x1 input invalid x2 output h level output xt1 input invalid (stop) operate (idle3, rtcfc=1) xt2 output h level output (stop) operate (idle3, rtcfc=1) clk output h level output (clkmod=0) l level output (clkmod=00) h or l level output (clkmod=10) input : the input gate is functioning. apply a low or high level to prevent the input pin from floating output : placed in the output state invalid : the input is invalid. high-z : high impedance. note) when rtcfc=1.
tmp92cd54i 2009-12-26 92cd54i-22 tentative 3.4 interrupts interrupts for the tlcs-900/h1 are controlled using the cpu interrupt mask flip-flop (sr) and the interrupt controller. the tmp92cd54i supports the fo llowing 60 interrupt sources: interrupts generated by cpu: 9 sources ? software interrupts: 8 sources ? illegal instruction interrupt: 1 source internal interrupts: 42 sources ? internal i/o interrupts: 34 sources ? micro dma transfer end interrupts: 8 sources external interrupts: 9 sources ? interrupts on external pins ( nmi , int0 to int7) each interrupt source is assigned a unique in terrupt vector number (fixed) and each maskable interrupt can be assigned one o f six priority levels (variable). nonmaskable interrupts have a fixed priority level of 7 (top priority). when an interrupt occurs, the interrupt controller se nds the priority level of that interrupt source to the cpu. when more than one interrupt occurs simultaneously, it sends the highest priority level to the cpu (the highest possible level is 7 for nonmaskable interrupts). the cpu compares the sent priority level with the value in the cpu interrupt mask register (iff2:0) and, if the priority level is higher than the interrupt mask register setting, accepts the interrupt. software interrupts and undefined instruct ion execution interrupts, however, occur independently of the iff2:0 setting. the value of the interrupt mask register sr can be modified using the ei instruction (ei num, where num specifies the contents of sr). for example, programming "ei 3" enables maskable interrupts having a priority level of 3 or higher, as specified with the interrupt controller, and nonmaskable interrupts to be accepted. exec uting the ei or "ei 0" instruction enables all nonmaskable interrupts and maskable interrupts havi ng a priority level of 1 or higher to be accepted. (therefore, they ar e equivalent to "ei 1".) the di instruction (specifying 7 for sr) is functionally equivalent to "ei 7" and used to disable the acceptance of maskable interrupts because they have priori ty levels of 0 to 6. the ei instruction is effective immediately after it is executed. interrupts for the tlcs-900/h1 also supports mi cro dma handling mode in addition to the general-purpose interr upt handling mode described abov e. in micro dma mode, the cpu automatically transfers data (1, 2, or 4 bytes). it enables fast data transfer to internal/external memory and built-in i/o. moreover, the tmp92cd54i supports a soft start function, which enables software to issue a micro dma request, rather than given from an interrupt source. figure 3.4.1 shows the entire interrupt handling flow.
tmp92cd54i 2009-12-26 92cd54i-23 tentative figure 3.4.1 interrupt and micro dma processing sequence general-purpose interrupt processing yes push pc push sr sr level of accepted interrupt + 1 intnest intnest + 1 end pc (ffff00h + v) interrupt processing program z?I count count ? 1 data transfer by micro dma no micro dma processing reti instruction pop sr pop pc intnest intnest ? 1 interrupt a specified by micro dma start vector? clear vector register generating micro dma transfe r end interrupt (inttc0 to 7) clear interrupt request flag interrupt vector calue ?v? read interrupt request f/f clear interrupt processing count = 0 yes no micro dma soft start request ? ? micro dma is initiated by a write cycle which writes to the registe r dmar
tmp92cd54i 2009-12-26 92cd54i-24 tentative 3.4.1 general-purpose interrupt handling when the cpu accepts an interrupt, it performs the following operation. for software interrupts issued by the cpu and undefined instruction execution interrupts, the cpu only performs steps (2), (4), and (5) without executing steps (1) and (3). the following steps are similar to those for the tlcs-900/l, tlcs-900/h, tlc s-900/l1, and tlcs-900/h2. (1) the cpu reads an interrupt vector from the interrupt controller. if two or more interrupts having the same priority level occur simultaneously, the cpu issues an interrupt vector according to the de fault priorities (fixed: smaller vector values have higher priority) and clears the interrupt request. (2) the cpu pushes the program counter (pc) and status register (sr) into the stack area (pointed to by xsp). (3) set the cpu interrupt mask register sr to the value of the accepted interrupt level plus one. if the value is 7, however, the value of 7 is set without being incremented. (4) increment the interrupt nesting counter intnest by one. (5) the cpu jumps to the address indicated wi th the data at address (ffff00h + interrupt vector) and then starts the interrupt handling routine. upon the completion of interrupt handling, usua lly use the reti instruction to return to the main routine. this instruction restores the values of the program counter (pc) and status register (sr) from the stack and then decrement the interrupt nesting counter (intnest) by one. the acceptance of nonmaskable interrupts cannot be disabled programmatically. on the other hand, maskable interrupts can be enabled or disabled programmatically and can be assigned priorities for each interrupt source (an interrupt level of 0 or 7 disables the interrupt request). the cpu accepts an interrupt if the priority level of the interrupt request is higher than the value of its interrupt mask register sr. it then sets the mask register to the value of the accepted priority plus one. therefore, if any interrupt having a priority higher than the interrupt currently being handled occurs, the cpu accepts that interrupt request, resulting in interrupt handling being nested. if another interrupt request is issued while the cpu is performing steps (1) to (5) above for an interrupt it has accepted, the new interrupt request is sampled immediately after the first instruction of the interrupt handling routine is executed. the di instruction can be used as the first instruction to prohibit the nesting of maskable interrupts. upon a reset, the cpu mask register sr is initialized to 7, which disables maskable interrupts. in the tmp92cd54i, memory addresses ffff00h to ffffefh (240 bytes) are assigned to the interrupt vector area. table 3.4.1 shows the interrupt table.
tmp92cd54i 2009-12-26 92cd54i-25 tentative table 3.4.1 tmp92cd54i interrupt vectors and micro dma start vectors default priority type interrupt source and source of micro dma request vector value address refer to vector micro dma start vector 1 reset or [swi0] instruction 0000h ffff00h 2 [swi1] instruction 0004h ffff04h 3 illegal instruction or [swi2] instruction 0008h ffff08h 4 [swi3] instruction 000ch ffff0ch 5 [swi4] instruction 0010h ffff10h 6 [swi5] instruction 0014h ffff14h 7 [swi6] instruction 0018h ffff18h 8 [swi7] instruction 001ch ffff1ch 9 nmi: pin input 0020h ffff20h 10 non maskable intwd: watchdog timer 0024h ffff24h - micro dma - - - 11 int0: int0 pin input (note2) 0028h ffff28h 0ah 12 int1: int1 pin input 002ch ffff2ch 0bh 13 int2: int2 pin input 0030h ffff30h 0ch 14 int3: int3 pin input 0034h ffff34h 0dh 15 int4: int4 pin input 0038h ffff38h 0eh 16 int5: int5 pin input 003ch ffff3ch 0fh 17 int6: int6 pin input 0040h ffff40h 10h 18 int7: int7 pin input 0044h ffff44h 11h 19 intt0: 8-bit timer 0 0048h ffff48h 12h 20 intt1: 8-bit timer 1 004ch ffff4ch 13h 21 intt2: 8-bit timer 2 0050h ffff50h 14h 22 intt3: 8-bit timer 3 0054h ffff54h 15h 23 intt4: 8-bit timer 4 0058h ffff58h 16h 24 intt5: 8-bit timer 5 005ch ffff5ch 17h 25 intt6: 8-bit timer 6 0060h ffff60h 18h 26 intt7: 8-bit timer 7 0064h ffff64h 19h 27 inttr8: 16-bit timer 8 0068h ffff68h 1ah 28 inttr9: 16-bit timer 8 006ch ffff6ch 1bh 29 inttra: 16-bit timer a 0070h ffff70h 1ch 30 inttrb: 16-bit timer a 0074h ffff74h 1dh 31 intto8: 16-bit timer 8 (overflow) 0078h ffff78h 1eh 32 inttoa: 16-bit timer a (overflow) 007ch ffff7ch 1fh 33 intrx0: serial receive (channel 0) 0080h ffff80h 20h (note3) 34 inttx0: serial transmission (channel 0) 0084h ffff84h 21h 35 intrx1: serial receive (channel 1) 0088h ffff88h 22h (note3) 36 inttx1: serial transmission (channel 1) 008ch ffff8ch 23h 37 intcr: can receive 0090h ffff90h 24h (note3) 38 intct: can transmission 0094h ffff94h 25h (note3) 39 intcg: can global 0098h ffff98h 26h (note3) 40 intsem: sei mode fault error 009ch ffff9ch 27h (note3) 41 intsee: sei transfer end / slave error 00a0h ffffa0h 28h (note3) 42 intser: sei receive 00a4h ffffa4h 29h 43 intset: sei transmission 00a8h ffffa8h 2ah 44 intrtc: read time counter 00ach ffffach 2bh 45 (reserved) 00b0h ffffb0h - 46 intsbe2: sbi i2cbus transfer e nd (channel 2) 00b4h ffffb4h 2dh 47 intsbs2: sbi i2cbus stop conditi on (channel 2) 00b8h ffffb8h 2eh 48 intsbe0: sbi i2cbus transfer end (channel 0) 00bch ffffbch 2fh 49 intsbs0: sbi i2cbus stop condition (channel 0) 00c0h ffffc0h 30h 50 maskable intsbe1: sbi i2cbus transfer end (channel 1) 00c4h ffffc4h 31h
tmp92cd54i 2009-12-26 92cd54i-26 tentative default priority type interrupt source and source of micro dma request vector value address refer to vector micro dma start vector 51 intsbs1: sbi i2cbus stop conditi on (channel 1) 00c8h ffffc8h 32h 52 intad: ad conversion end 00cch ffffcch 33h 53 inttc0: micro dma end (channel 0) 00d0h ffffd0h 34h 54 inttc1: micro dma end (channel 1) 00d4h ffffd4h 35h 55 inttc2: micro dma end (channel 2) 00d8h ffffd8h 36h 56 inttc3: micro dma end (channel 3) 00dch ffffdch 37h 57 inttc4: micro dma end (channel 4) 00e0h ffffe0h 38h 58 inttc5: micro dma end (channel 5) 00e4h ffffe4h 39h 59 inttc6: micro dma end (channel 6) 00e8h ffffe8h 3ah 60 inttc7: micro dma end (channel 7) 00ech ffffech 3bh ? to ? maskable (reserved) 00f0h to 00fch fffff0h to fffffch ? to ? note1: to start micro dma, select edge detection mode. note2: micro dma processing cannot be assigned. note3: if an interrupt occurs with an interrupt source specified for micro dma, it is given the highest priority among maskable interrupts (independently of the default priority assigned to each channel). note4: the above table lists only start addresses. each vector consists of four bytes.
tmp92cd54i 2009-12-26 92cd54i-27 tentative 3.4.2 micro dma the tmp92cd54i supports the micro dma function . interrupt requests specified for the micro dma function are handled with the highest priority among maskable interrupts regardless of the set interrupt level. eight channels are provided for micro dma and support continuous transfer using a burst specification, described later. (1) micro dma operation when an interrupt request specified with the micro dma start vector register is issued, the micro dma function transfers data to the cp u with the highest priority among maskable interrupts regardless of the interrupt level assign ed to the interrupt source. if sr = 7, micro dma requests are not accepted. the micro dma function supports eight channels; micro dma can be specified for up to eight types of interrupt sour ce simultaneously. when micro dma is accepted, the function clears the interrupt request flag assigned to that channel, performs a single data transfer (1, 2, or 4 bytes) from the source address to the destination address, as set in the control regi ster, and then decrements the transferred data counter. if the counter becomes 0 after being decremented, the following operation is performed: ? the cpu notifies the interrupt controller of the completion of micro dma transfer. ? the interrupt controller issues a micro dma transfer completion interrupt (inttcn). ? the micro dma start vector register, dmanv, is cleared to 0, thus disabling the start of subsequent micro dma. ? micro dma processing is completed. if the counter is not 0 after being decremented, micro dma processing is terminated unless a burst is specified as described later. in that case, a transfer completion interrupt (inttcn) does not occur. if an interrupt source is used only to start micro dma, the interrupt level for that source should be set to 0. this is because, if that interrupt request is issued before the micro dma start vector is set, the cpu performs general-purpose interrupt handling if the interrupt level is 1 to 6. if micro dma interrupts are shared with genera l-purpose interrupts, interrupt sources used to start micro dma should have an interrupt level lower than those for all other interrupt sources. the priority of a micro dma transfer completi on interrupt is determined according to the interrupt level and default priority, in the same way as with other maskable interrupts. if micro dma requests for two or more channels are issued simultaneously, requests for lower channel numbers are given hi gher priorities (ch0 is the highest and ch7 is the lowest), regardless of their interrupt levels. the registers that specify the transfer source and destinatio n addresses are 32-bit control registers. the micro dma function, however, handles 16 mbytes of space because there are only 24 address output lines. three transfer modes, 1, 2 and 4 bytes, are supported. for each transfer mode, the transfer source and destination addresses can be incre mented, decremented or fixed after transfer. this facilitates data transfer from memory to memory, from i/o to memory, from memory to i/o, and from i/o to i/o. for details of transf er modes, see "(4) deta ils of transfer mode registers."
tmp92cd54i 2009-12-26 92cd54i-28 tentative the transferred data counter consists of 16 bits so that up to 65536 micro dma transfers can be performed for a single inte rrupt source (the maximum numbe r is allowed when the initial value of the counter is 0000h). micro dma supports 44 types of interrupt sources: 43 sources listed in table 3.4.1 with micro dma start vectors, plus soft start. figure 3.4.2 shows micro dma cycles in transfer address inc mode (similar in other modes, except counter mode) (with an 8-bit external bus, 0 waits, and even-numbered source and destination addresses). src one state clk a0 23 1 2 3 4 5 dst figure 3.4.2 timing for micro dma cycle 1st and 2nd states: instruction fetch cycle (prefetch the next instruction code) if the instruction queue buffer is full, this cycle becomes a dummy cycle. 3rd state: micro dma read cycle 4th state: micro dma write cycle 5th state: (same as 1st and 2nd states) (2) soft start function the tmp92cd54i supports a micro dma soft start function, which starts micro dma when a dmar register write cycle occurs rather than when an interrupt request is issued. specifically, a write of 1 to a bit in the dmar register can start a single micro dma transfer. upon the completion of transfer, the dmar register bit corresponding to the transferred channel is automatically cleared to 0. rewriting a 1 to the dmar register can perform a soft start again unless the micro dma transfer counter is 0. if a burst is specified with the dmar register, once micro dma is started, data is transferred continuously until the mi cro dma transfer counter becomes 0. symbol name address 7 6 5 4 3 2 1 0 dreq7 dreq6 dreq5 dreq4 dreq3 dreq2 dreq1 dreq0 r/w dmar dma request 109h (no rmw) 0 0 0 0 0 0 0 0 rmw prohibited: a read-modify-write operation cannot be performed. figure 3.4.3 micro dm a request register
tmp92cd54i 2009-12-26 92cd54i-29 tentative (3) transfer control registers the following registers specify the transfer so urce and destination addresses. the ldc cr,r instruction is used to set data in these registers. channel 0 dmas0 dma source address register 0 dmad0 dma destination address register 0 dmac0 dma counter register 0 dmam0 dma mode register 0 channel 7 dmas7 dma source address register 7 dmad7 dma destination address register 7 dmac7 dma counter register 7 dmam7 dma mode register 7 8 bits 16 bits 32 bits figure 3.4.4 micro dm a transfer register
tmp92cd54i 2009-12-26 92cd54i-30 tentative (4) details of transf er mode registers 0 0 0 mode dmam0 to 7 dmam[4:0] mode description execution time 0 0 0 z z destination inc mode (dmadn +) (dmasn) dmacn dmacn - 1 if dmacn = 0 then inttcn 5states 0 0 1 z z destination dec mode (dmadn -) (dmasn) dmacn dmacn - 1 if dmacn = 0 then inttcn 5states 0 1 0 z z source inc mode (dmadn) (dmasn +) dmacn dmacn - 1 if dmacn = 0 then inttcn 5states 0 1 1 z z source dec mode (dmadn) (dmasn -) dmacn dmacn ? 1 if dmacn = 0 then inttcn 5states 1 0 0 z z source and destination inc mode (dmadn +) (dmasn +) dmacn dmacn ? 1 if dmacn = 0 then inttcn 6states 1 0 1 z z source and destination dec mode (dmadn -) (dmasn -) dmacn dmacn ? 1 if dmacn = 0 then inttcn 6states 1 1 0 z z destination and fixed mode (dmadn) (dmasn) dmacn dmacn ? 1 if dmacn = 0 then inttcn 5states counter mode 1 1 1 z z dmasn dmasn + 1 dmacn dmacn ? 1 if dmacn = 0 then inttcn 5states zz: 00 = 1-byte transfer 01 = 2-byte transfer 10 = 4-byte transfer 11 = (reserved) note1: the execution times shown above are best-c ase values (assuming that memory access is completed in a single clock cycle). 1 state = 50 ns (when fc = 20 mhz) note2: n indicates the micro dma channel number (0 to 7). dmadn+/dmasn+: post-increment (register value is incremented after transfer) dmadn-/dmasn-: post-decrement (register value is decremented after transfer) figure 3.4.5 details of transfer mode registers
tmp92cd54i 2009-12-26 92cd54i-31 tentative 3.4.3 control by the interrupt controller figure 3.4.16 shows a block diagram of the interrupt circuit. the left half of the figure represents the interrupt controller while th e right half represents the cpu interrupt request signal circuit and halt release circuit. the interrupt controller has an interrupt reques t flag, interrupt priority setup register and micro dma start vector setup register for each interrupt channel (51 channels in total). the interrupt request flag is used to latch an interrupt request from a peripheral device. this flag is cleared under the following conditions: ? upon a reset ? when the cpu accepts the interrupt and reads the vector for that interrupt. ? when the instruction that clears the interrupt is executed (the micro dma start vector for the interrupt source to be cleared is written to the intclr register). ? the cpu accepts a micro dma request for that interrupt. ? the micro dma burst transfer for that interrupt is completed. interrupt priorities can be set by writing th em to the interrupt priority setup registers (inte0ad, inte12, and so on) that are provided for each interrupt source. one of six interrupt levels, 1 to 6, can be set. writing a priority le vel of 0 (or 7) causes th e corresponding interrupt request to be disabled. nonmaskable interrupts (n mi pin) have a fixed priority level of 7. if more than one interrupt request having the same priority level occurs simultaneously, the cpu accepts an interrupt according to the default priorities (lower priority value = smaller vector). reading bits 3 and 7 in the interrupt priority setup register returns the state of the interrupt request flag, which indicates whether an interrupt request has been issued for each channel. among the interrupts that have occurred simult aneously, the interrupt controller sends the highest interrupt priority level and its vector address to the cpu. the cpu compares the sent interrupt level with the interrupt mask register va lue in the status register and, if the sent level is higher, accepts the interrupt. the cpu then sets the accepted interrupt level + 1 in its sr so that only interrupt requests havi ng a priority higher than that can be accepted in a nested manner. upon the completion of interrupt handling (execution of the reti instruction), the cpu restores the value of the interrupt mask register existing before the interrupt occurred in sr. the interrupt controller has registers (eight channels) that store micro dma start vectors. writing a start vector (see table 3.4.1) in this register enables micro dma to start when the corresponding interrupt request is issued. it is necessary to set values in the micro dma parameter registers (such as dmas and dmad ) before enabling micro dma processing.
tmp92cd54i 2009-12-26 92cd54i-32 tentative interrupt request si g nal to cpu if 1 Q iff2:0 Q 6 then 1. micro dma start vector setting register inttc0 inttc1 inttc2 inttc3 inttc4 inttc5 inttc6 inttc7 v = d0h v = d4h v = d8h v = dch v = e0h v = e4h v = e8h v = ech soft start micro dm a counte r zero interrupt 6 inttc0 during idle1 51 3 3 3 1 6 1 7 3 3 8 6 6 8 input or int0 micro dma channel priority encoder priority encoder dma0v dma1v : dma7v reset interrupt request f/f reset decoder reset priority setting register v = 20h v = 24h interrupt controller cpu s q r v = 28h v = 2ch v = 30h v = 34h v = 38h v = 3ch v = 40h v = 44h v = 48h v = 4ch d q clr y1 y2 y3 y4 y5 y6 a b c dn dn + 1 dn + 2 interrupt request f/f interrupt vector read micro dma acknowledge interrupt request f/f dn + 3 a b c interrupt vector read d2 d3 d4 d5 d6 d7 match detect s q r 0 1 2 3 4 5 6 7 a b c d0 d1 interrupt vecto r v read interrupt mask f/f micro dma request halt release nmi if intrq2:0 R iff2:0 then 1. intrq2 to 0 iff2:0 interrupt level detect reset ei 1 to 7 di interrupt request signal during stop micro dma channel specification reset nmi intwd int0 int1 int2 int3 int4 int5 int6 int7 intt0 intt1 interrupt vector generator highest priority interrupt level select 1 2 3 4 5 6 7 d5 d4 d3 d2 d1 d0 d q clr 6 figure 3.4.6 block diagram of interrupt controller
tmp92cd54i 2009-12-26 92cd54i-33 tentative (1) interrupt priority setup registers symbol name address 7 6 5 4 3 2 1 0 intad int0 (note) iadc iadm2 iadm1 iadm0 i0c i0m2 i0m1 i0m0 r r/w r r/w inte0ad int0 & intad enable f0h 0 0 0 0 0 0 0 0 int2 int1 i2c i2m2 i2m1 i2m0 i1c i1m2 i1m1 i1m0 r r/w r r/w inte12 int1 & int2 enable d0h 0 0 0 0 0 0 0 0 int4 int3 i4c i4m2 i4m1 i4m0 i3c i3m2 i3m1 i3m0 r r/w r r/w inte34 int3 & int4 enable d1h 0 0 0 0 0 0 0 0 int6 int5 i6c i6m2 i6m1 i6m0 i5c i5m2 i5m1 i5m0 r r/w r r/w inte56 int5 & int6 enable d2h 0 0 0 0 0 0 0 0 int7 - - - - i7c i7m2 i7m1 i7m0 r r/w inte7 int7 enable d7h - - - - 0 0 0 0 intt1(timer1) intt0(timer0) it1c it1m2 it1m1 it1m0 it0c it0m2 it0m1 it0m0 r r/w r r/w intet01 intt0 & intt1 enable d4h 0 0 0 0 0 0 0 0 intt3(timer3) intt2(timer2) it3c it3m2 it3m1 it3m0 it2c it2m2 it2m1 it2m0 r r/w r r/w intet23 intt2 & intt3 enable d5h 0 0 0 0 0 0 0 0 intt5(timer5) intt4(timer4) it5c it5m2 it5m1 it5m0 it4c it4m2 it4m1 it4m0 r r/w r r/w intet45 intt4 & intt5 enable d6h 0 0 0 0 0 0 0 0 intt7(timer7) intt6(timer6) it7c it7m2 it7m1 it7m0 it6c it6m2 it6m1 it6m0 r r/w r r/w intet67 intt6 & intt7 enable d7h 0 0 0 0 0 0 0 0 inttr9(timer8) inttr8(timer8) it9c it9m2 it9m1 it9m0 it8c it8m2 it8m1 it8m0 r r/w r r/w intet89 inttr8 & inttr9 enable d8h 0 0 0 0 0 0 0 0 inttrb(timera) inttra(timera) itbc itbm2 itbm1 itbm0 itac itam2 itam1 itam0 r r/w r r/w intetab inttra & inttrb enable d9h 0 0 0 0 0 0 0 0 inttoa intto8 itoac itoam2 itoam1 itoam0 ito8c ito8m2 ito8m1 ito8m0 r r/w r r/w inteto8a intto8 & inttoa (overflow) enable dah 0 0 0 0 0 0 0 0 note 1: if any bit of wupmask is set to 1, the i nput signal from the external int0 pin is disabled. to use the external int0 pin, write 00h to wupmask to disable the wakeup interrupt function. figure 3.4.7 interrupt prio rity setup registers (1/3)
tmp92cd54i 2009-12-26 92cd54i-34 tentative symbol name address 7 6 5 4 3 2 1 0 inttx0 intrx0 itx0c itx0m2 itx0m1 itx0m0 irx0c irx0m2 irx0m1 irx0m0 r r/w r r/w intes0 intrx0 & inttx0 enable dbh 0 0 0 0 0 0 0 0 inttx1 intrx1 itx1c itx1m2 itx1m1 itx1m0 irx1c irx1m2 irx1m1 irx1m0 r r/w r r/w intes1 intrx1 & inttx1 enable dch 0 0 0 0 0 0 0 0 intct intcr ictc ictm2 ictm1 ictm0 icrc icrm2 icrm1 icrm0 r r/w r r/w intecrt intcr & intct enable ddh 0 0 0 0 0 0 0 0 intcg - - - - icgc icgm2 icgm1 icgm0 r r/w intecg intcg enable deh - - - - 0 0 0 0* intsee0 intsem0 isee0c isee0m2 isee0m1 isee0m0 isem0c isem0m2 isem0m1 isem0m0 r r/w r r/w intesee0 intsem0 & intsee0 enable dfh 0 0 0 0 0 0 0 0 intset0 intser0 iset0c iset0m2 iset0m1 iset0m0 iser0c iser0m2 iser0m1 iser0m0 r r/w r r/w intesed0 intser0 & intset0 enable e0h 0 0 0 0 0 0 0 0 intrtc - - - - irtcc irtcm2 irtcm1 irtcm0 r r/w intertc intrtc enable e1h - - - - 0 0 0 0 intsbs2 intsbe2 isbs2c isbs2m2 isbs2m1 isbs2m0 isbe2c isbe2m2 isbe2m1 isbe2m0 r r/w r r/w intesb2 intsbe2 & intsbs2 enable e2h 0 0 0 0 0 0 0 0 intsbs0 intsbe0 isbs0c isbs0m2 isbs0m1 isbs0m0 isbe0c isbe0m2 isbe0m1 isbe0m0 r r/w r r/w intesb0 intsbe0 & intsbs0 enable e3h 0 0 0 0 0 0 0 0 intsbs1 intsbe1 isbs1c isbs1m2 isbs1m1 isbs1m0 isbe1c isbe1m2 isbe1m1 isbe1m0 r r/w r r/w intesb1 intsbe1 & intsbs1 enable e4h 0 0 0 0 0 0 0 0 inttc1(dma1) inttc0(dma0) itc1c itc1m2 itc1m1 itc1m0 itc0c itc0m2 itc0m1 itc0m0 r r/w r r/w intetc01 inttc0 & inttc1 enable f1h 0 0 0 0 0 0 0 0 inttc3(dma3) inttc2(dma2) itc3c itc3m2 itc3m1 itc3m0 itc2c itc2m2 itc2m1 itc2m0 r r/w r r/w intetc23 inttc2 & inttc3 enable f2h 0 0 0 0 0 0 0 0 inttc5(dma5) inttc4(dma4) itc5c itc5m2 itc5m1 itc5m0 itc4c itc4m2 itc4m1 itc4m0 r r/w r r/w intetc45 inttc4 & inttc5 enable f3h 0 0 0 0 0 0 0 0 inttc7(dma7) inttc6(dma6) itc7c itc7m2 itc7m1 itc7m0 itc6c itc6m2 itc6m1 itc6m0 r r/w r r/w intetc67 inttc6 & inttc7 enable f4h 0 0 0 0 0 0 0 0 figure 3.4.8 interrupt prio rity setup registers (2/3)
tmp92cd54i 2009-12-26 92cd54i-35 tentative symbol name address 7 6 5 4 3 2 1 0 nmi intwd inmic - - - iwdc - - - r r intnmwdt nmi & intwd enable f7h 0 - - - 0 - - - lxxm2 lxxm1 lxxm0 function ( write ) 0 0 0 disables interrupt requests 0 0 1 sets interrupt priority level to 1 0 1 0 sets interrupt priority level to 2 0 1 1 sets interrupt priority level to 3 1 0 0 sets interrupt priority level to 4 1 0 1 sets interrupt priority level to 5 1 1 0 sets interrupt priority level to 6 1 1 1 disables interrupt requests note: to modify an interrupt priority setup register, first execute the di instruction to disable the acceptance of interrupts. figure 3.4.9 interrupt prio rity setup registers (3/3) (2) controlling external interrupts symbol name address 7 6 5 4 3 2 1 0 - - - - - - i0le nmiree r/w - - - - - - 0 0 iimc interrupt input mode control f6h (no rmw) i n t 0 m o d e 0:edge mode 1:level mode nmi mode 0:falling edge 1:falling & rising edges int0 level enable 0 rising edge detect int 1 ?h? level int nmi rising edge enable 0 int request generation at falling edge 1 int request generation at rising and falling edge note 1: to switch the int0 pin mode from level to edge (iimc from 1 to 0), first disable int0. in that case, execute ei instruction after three cycles (after three nop instructions are executed). example settings: the following shows an example of settings for switching the int0 interrupt from level to edge mode. di ; disable interrupt ld (iimc), xxxxxx0-b ; switch from level to edge ld (intclr), 0ah ; clear interrupt request flag nop ; wait for 3 cycles nop nop ei ; enable interrupt x = don?t care ?-? = no change . note 2: the input pulse width for an external interrupt must satisfy the specification. for details, see "4. electrical characteristics." figure 3.4.10 controlling external interrupts interrupt request flag
tmp92cd54i 2009-12-26 92cd54i-36 tentative table 3.4.2 settings of external interrupt pin function interrupt pin name mode setting method fallin g ed g e iimc = 0 nmi nmi falling and rising edges iimc = 1 rising edge iimc = 0 int0 int0 high level iimc = 1 int1 pc0 rising edge - int2 pc2 rising edge - int3 pc3 rising edge - int4 pc5 rising edge - rising edge tmod8 = 0,0 or 0,1 or 1,1 int5 pd0 falling edge tmod8 = 1,0 int6 pd1 rising edge - rising edge tmoda = 0,0 or 0,1 or 1,1 int7 pd4 falling edge tmoda = 1,0 falling and rising edges wupmod = 0 falling edge wupmod = 1 and wupedge = 0 wuint0 pd0 rising edge wupmod = 1 and wupedge = 1 falling and rising edges wupmod = 0 falling edge wupmod = 1 and wupedge = 0 wuint1 pd1 rising edge wupmod = 1 and wupedge = 1 falling and rising edges wupmod = 0 falling edge wupmod = 1 and wupedge = 0 wuint2 pd2 rising edge wupmod = 1 and wupedge = 1 falling and rising edges wupmod = 0 falling edge wupmod = 1 and wupedge = 0 wuint3 pd3 rising edge wupmod = 1 and wupedge = 1 falling and rising edges wupmod = 0 falling edge wupmod = 1 and wupedge = 0 wuint4 pd4 rising edge wupmod = 1 and wupedge = 1 falling and rising edges wupmod = 0 falling edge wupmod = 1 and wupedge = 0 wuint5 pd5 rising edge wupmod = 1 and wupedge = 1 falling and rising edges wupmod = 0 falling edge wupmod = 1 and wupedge = 0 wuint6 pd6 rising edge wupmod = 1 and wupedge = 1 falling and rising edges wupmod = 0 falling edge wupmod = 1 and wupedge = 0 wuint7 pd7 rising edge wupmod = 1 and wupedge = 1
tmp92cd54i 2009-12-26 92cd54i-37 tentative (3) interrupt request flag register the interrupt request flag can be cleared by wr iting a micro dma start vector, listed in table 3.4.1, to the intclr register. to clear the int0 interrupt flag, for example, perform the following register operation after the di instruction: intclr 0ah ; clear int0 interrupt request flag symbol name address 7 6 5 4 3 2 1 0 - - - - - - - - w 0 0 0 0 0 0 0 0 intclr interrupt clear control f8h (no rmw) interrupt vector figure 3.4.11 interrupt request flag register (4) micro dma start vector registers the micro dma start vector registers are used to select the interrupt sources to which micro dma processing is assi gned. interrupt sources having micro dma start vectors that match the vector values in the registers are assigned as micro dma start sources. when the micro dma transfer counter becomes 0, th e interrupt controller is notified of a micro dma transfer completion interrupt for that channel and the corresponding micro dma start vector register is cleared, causing the micro dma start source for the channel to be cleared. to continue micro dma processing, therefore, it is necessary to set the micro dma start vector register again while the micro dma transfer completion interrupt is handled. if the same vector is set in micro dma start vect or registers for more than one channel, smaller channels take precedence. if the same vector is set in micro dma start vector register for two channels, therefore, micro dma for the channel having the smaller number is performed until the micro dma transfer completion interrupt is issued, after which micro dma is started for the larger-number channel unless the micro dma start vector for th e smaller-number channel is set again.
tmp92cd54i 2009-12-26 92cd54i-38 tentative symbol name address 7 6 5 4 3 2 1 0 dma0 start vector - - dma0v5 dma0v4 dma0v3 dma0v2 dma0v1 dma0v0 r/w dma0v dma0 start vector 100h (no rmw) - - 0 0 0 0 0 0 dma1 start vector - - dma1v5 dma1v4 dma1v3 dma1v2 dma1v1 dma1v0 r/w dma1v dma1 start vector 101h (no rmw) - - 0 0 0 0 0 0 dma2 start vector - - dma2v5 dma2v4 dma2v3 dma2v2 dma2v1 dma2v0 r/w dma2v dma2 start vector 102h (no rmw) - - 0 0 0 0 0 0 dma3 start vector - - dma3v5 dma3v4 dma3v3 dma3v2 dma3v1 dma3v0 r/w dma3v dma3 start vector 103h (no rmw) - - 0 0 0 0 0 0 dma4 start vector - - dma4v5 dma4v4 dma4v3 dma4v2 dma4v1 dma4v0 r/w dma4v dma4 start vector 104h (no rmw) - - 0 0 0 0 0 0 dma5 start vector - - dma5v5 dma5v4 dma5v3 dma5v2 dma5v1 dma5v0 r/w dma5v dma5 start vector 105h (no rmw) - - 0 0 0 0 0 0 dma6 start vector - - dma6v5 dma6v4 dma6v3 dma6v2 dma6v1 dma6v0 r/w dma6v dma6 start vector 106h (no rmw) - - 0 0 0 0 0 0 dma7 start vector - - dma7v5 dma7v4 dma7v3 dma7v2 dma7v1 dma7v0 r/w dma7v dma7 start vector 107h (no rmw) - - 0 0 0 0 0 0 figure 3.4.12 micro dma start vector registers (5) micro dma burst specification a burst specification allows data to be transfer red continuously with a single micro dma start until the transfer count register becomes zero. a burst can be specified by writing a 1 to the bit corresponding to the micro dma channel in the dmab register. symbol name address 7 6 5 4 3 2 1 0 dbst7 dbst6 dbst5 dbst4 d bst3 dbst2 dbst1 dbst0 r/w dmab dma burst 108h (no rmw) 0 0 0 0 0 0 0 0 figure 3.4.13 micro dma burst specification
tmp92cd54i 2009-12-26 92cd54i-39 tentative (6) precautions this cpu consists of an instruction execution unit and a bus interface unit. if an instruction that clears the interrupt request flag for the interrupt controller is executed immediately before a corresponding interrupt occurs, the cpu may ex ecute the instruction clearing the interrupt request flag(note) before it reads the interrupt ve ctor after accepting the interrupt. in such a case, the cpu reads the source lost vector "0004h" (shared with swi1) and then reads the interrupt vector at address ffff04h. to avoid the above situation, any instruction that clears an interrupt request flag should be placed after the di instruction. to change th e interrupt request level to 0, first clear the corresponding interrupt request using the intc lr instruction before setting the interrupt request level to 0. in addition, note that the following two interru pts are different from other interrupt circuits: in level mode int0 is not an edge-triggered interrupt. hence, in level mode the interrupt request flip -flop for int0 does not function. the peripheral interrupt request passes through the s input of the flip-flop and becomes the q output. if the interrupt input mode is changed from edge mode to level mode, the interrupt request flag is cleared automatically. int0 level mode if the cpu enters the interr upt response sequence as a result of int0 going from 0 to 1, int0 must then be held at 1 until the interrupt response sequence has been completed. if int0 is set to level mode so as to release a halt state, int0 must be held at 1 from the time int0 changes from 0 to 1 until the halt state is released. (hence, it is necessary to ensure that input noise is not interpreted as a 0, causing int0 to revert to 0 before the halt state has been released.) when the mode changes from level mode to edge mode, interrupt request flags which were set in level mode will not be cleared. interrupt request flags must be cl eared using the fo llowing sequence. also ei instruction should be execuse after waiting 3-cycle. di ld (iimc), 00h ; switches from level to edge. ld (intclr), 0ah ; clears interrupt request flag. nop ; wait 3-cycle nop nop ei intrx the interrupt request flip-flop can only be cleared by a reset or by reading the serial channel receive buffer. it cannot be cleared by an instruction. note: the following instructions and pin state chang e are also equivalent to an instruction that clears an interrupt request flag: int0: instruction that switches to level mode af ter an interrupt request is issued in edge mode change in pin input state (high to low) after an interrupt request is issued in level mode intrx: instruction that reads the receive buffer
tmp92cd54i 2009-12-26 92cd54i-40 tentative 3.4.4 interrupt mask registers the tmp92cd54i contains interrupt mask regi sters. unlike the interrupt priority setup registers, the interrupt mask registers only enable or disable interrupt handling. if an interrupt source is disabled in the interrupt mask register, interrupts for that source will not occur even if it is enabled in the inte rrupt priority setup register. interrupt mask registers can disable mo re than one interrupt source simultaneously. upon a reset, all bits in the interrupt mask registers are initialized to 1 (enable interrupts). to disable interrupts using the inte rrupt mask registers, it is necessary to write a 0 to the bit corresponding to the interrupt source. figure 3.4.14 block diagram of interrupt mask control 8-bit timer 16-bit timer rtc can sei sbi adc external interrupt int0 int1 int2 int3 int4 int5 int6 int7 sio intmk0 intmk1 intmk2 intmk3 intmk4 intmk5 8 1 6 3 4 4 1 6 8 1 6 3 4 4 1 6 8 6 1 4 3 4 6 1 8 6 1 4 3 4 6 1 41 interrupt controller
tmp92cd54i 2009-12-26 92cd54i-41 tentative symbol name address 7 6 5 4 3 2 1 0 mki7 mki6 mki5 mki4 mki3 mki2 mki1 mki0 r/w 1 1 1 1 1 1 1 1 intmk0 interrupt mask control 0 e5h int7 0: mask 1: enable int6 0: mask 1: enable int5 0: mask 1: enable int4 0: mask 1: enable int3 0: mask 1: enable int2 0: mask 1: enable int1 0: mask 1: enable int0 0: mask 1: enable mkit7 mkit6 mkit5 mkit4 mkit3 mkit2 mkit1 mkit0 r/w 1 1 1 1 1 1 1 1 intmk1 interrupt mask control 1 e6h intt7 0: mask 1: enable intt6 0: mask 1: enable intt5 0: mask 1: enable intt4 0: mask 1: enable intt3 0: mask 1: enable intt2 0: mask 1: enable intt1 0: mask 1: enable intt0 0: mask 1: enable ? mkirtc mkitoa mkito8 mkitrb mkitra mkitr9 mkitr8 r/w ? 1 1 1 1 1 1 1 intmk2 interrupt mask control 2 e7h intrtc 0: mask 1: enable inttoa 0: mask 1: enable intto8 0: mask 1: enable inttrb 0: mask 1: enable inttra 0: mask 1: enable inttr9 0: mask 1: enable inttr8 0: mask 1: enable ? mkicg mkict mkicr mkitx1 mkirx1 mkitx0 mkirx0 r/w ? 1 1 1 1 1 1 1 intmk3 interrupt mask control 3 e8h intcg 0: mask 1: enable intct 0: mask 1: enable intcr 0: mask 1: enable inttx1 0: mask 1: enable intrx1 0: mask 1: enable inttx0 0: mask 1: enable intrx0 0: mask 1: enable ? ? ? ? mkiset0 mkiser0 mkisee0 mkisem0 r / w ? ? ? ? 1 1 1 1 intmk4 interrupt mask control 4 e9h i n t s e t 0: mask 1: enable intser 0: mask 1: enable intsee 0: mask 1: enable intsem 0: mask 1: enable ? mkisbs2 mkisbe2 mkiad mkisbs1 mkisbe1 mkisbs0 mkisbe0 r/w ? 1 1 1 1 1 1 1 intmk5 interrupt mask control 5 eah intsbs2 0: mask 1: enable intsbe2 0: mask 1: enable intad 0: mask 1: enable intsbs1 0: mask 1: enable intsbe1 0: mask 1: enable intsbs0 0: mask 1: enable intsbe0 0: mask 1: enable maskable bit for intad request 0 intad is disabled 1 intad is enabled note: ports d0, d1, and d4 are assigned two interrupt sour ces each (pd0: int5/wuint0, pd1: int6/wuint1, pd4: int7/wuint4). if both interrupt requests are issued when interrupts are enabled, both are handled. to use only either of the two interrupt sources, di sable (mask) the other interrupt source using the interrupt mask register or wakeup mask register. figure 3.4.15 interrupt mask registers
tmp92cd54i 2009-12-26 92cd54i-42 tentative example register settings: to change the int0 interrupt priority level from 3 to 7, set as follows: di ; disable interrupt ld (intmk0), 00h ; disable int0 ld (inte0ad), 03h ; set int0 interrupt level to 3 ld (intclr), 0ah ; clear int0 interrupt request flag nop ; wait for 3 cycles nop nop ld (intmk0), 01h ; enable int0 ei ; enable interrupt : : ; programmed operation di ; disable interrupt ld (intmk0), 00h ; disable int0 ld (inte0ad), 07h ; set int0 interrupt level to 7 ld (intclr), 0ah ; clear int0 interrupt request flag nop ; wait for 3 cycles nop nop ld (intmk0), 01h ; enable int0 ei ; enable interrupt
tmp92cd54i 2009-12-26 92cd54i-43 tentative 3.4.5 wakeup interrupt controller the tmp92cd54i has eight wakeup pins (wuint0-7). input signals to those pins can be used to recover from the halt state. these pins are shared with port d (pd0-7). the input signal attribute can be set to rising edge, falling edge or rising/falling edges, separately for each pin. the signals can also be masked on a pin-by-pin basis. figure 3.4.16 block diagram of on/off logic the wakeup interrupt controller internally sends all interrupt signals on wuint0-7 to int0. any wuintn request that has been issued causes an int0 interrupt to be issued. like int0 interrupt request from external pins, int0 interrupt requests from the wuintn pin are also enabled or disabled using the interrupt priority setup and interrupt mask registers. a write of 1 to any bit in the wupmask register causes int0 to be placed in wakeup interrupt mode. in this mode, the wuintn signal for which a 1 is written in the wupmask register becomes valid and the input signal from the external int0 pin is invalidated. to use the external int0 pin, set the wupmask register to 00h. the edge selection for the wuintn signal can be set to rising edge, falling edge or rising/falling edges using the wupmod and wupedge registers. reading the wupflag register can determin e whether a wuintn interrupt request has been issued. input signals detection circuit wupedge wupmod wuint0 wuint7 a b selector s int0 wuint1 wuint2 wuint3 wuint4 wuint5 wuint6 int0 intmk0 wupmask 1 8 1 8 interrupt mask interrupt controller wupflag external interrupt
tmp92cd54i 2009-12-26 92cd54i-44 tentative wakeup flag status register 7 6 5 4 3 2 1 0 symbol wflg7 wflg6 wflg5 wf lg4 wflg3 wflg2 wflg1 wflg0 read/write r/w after reset 0 0 0 0 0 0 0 0 function wuint7 0:no request 1: request wuint6 0:no request 1: request wuint5 0:no request 1: request wuint4 0:no request 1: request wuint3 0:no request 1: request wuint2 0:no request 1: request wuint1 0:no request 1: request wuint0 0:no request 1: request wakeup mode control register 7 6 5 4 3 2 1 0 symbol wmd7 wmd6 wmd 5 wmd4 wmd3 wmd2 wmd1 wmd0 read/write r/w after reset 0 0 0 0 0 0 0 0 function wuint7 0:falling & rising edge 1:falling or rising edge wuint6 0:falling & rising edge 1:falling or rising edge wuint5 0:falling & rising edge 1:falling or rising edge wuint4 0:falling & rising edge 1:falling or rising edge wuint3 0:falling & rising edge 1:falling or rising edge wuint2 0:falling & rising edge 1:falling or rising edge wuint1 0:falling & rising edge 1:falling or rising edge wuint0 0:falling & rising edge 1:falling or rising edge wakeup edge select register 7 6 5 4 3 2 1 0 symbol wed7 wed6 wed 5 wed4 wed3 wed2 wed1 wed0 read/write r/w after reset 0 0 0 0 0 0 0 0 function wuint7 0:falling edge 1:rising edge wuint6 0:falling edge 1:rising edge wuint5 0:falling edge 1:rising edge wuint4 0:falling edge 1:rising edge wuint3 0:falling edge 1:rising edge wuint2 0:falling edge 1:rising edge wuint1 0:falling edge 1:rising edge wuint0 0:falling edge 1:rising edge note: the wupedge setting becomes valid when a 1 is written to the corresponding bit in wupmod. wakeup mask register 7 6 5 4 3 2 1 0 symbol wmk7 wmk6 wmk5 wmk4 wmk3 wmk2 wmk1 wmk0 read/write r/w after reset 0 0 0 0 0 0 0 0 function wuint7 0: disable 1: enable wuint6 0: disable 1: enable wuint5 0: disable 1: enable wuint4 0: disable 1: enable wuint3 0: disable 1: enable wuint2 0: disable 1: enable wuint1 0: disable 1: enable wuint0 0: disable 1: enable wakeup interrupt mask control 0 wuintn disabled (mask) 1 wuintn enabled note1: ports d0, d1, and d4 are assigned two interrupt sources each (pd0: int5/wuint0, pd1: int6/wuint1, pd4: int7/wuint4). if both interrupt requests are issued when interrupts are enabled, both are handled. to use only eith er of the two interrupt sources, disable (mask) the other interrupt source using the in terrupt mask register or wakeup mask register. the input signal to port d is detected as an inte rrupt regardless of whet her port d is set to input/output port, intn, or wuintn. for details, see the port block diagram. note2: if any bit of wupmask is set to 1, the input signal from the external int0 pin is disabled. to use the external int0 pin, wr ite 00h to wupmask to disable the wakeup interrupt function. figure 3.4.17 wakeup registers wupflag (00ech) wupedge (00eeh) wupmask (00efh) wupmod (00edh)
tmp92cd54i 2009-12-26 92cd54i-45 tentative example register settings: the following example sets wuint0 to rising edge and interrupt level 3: di ; disable interrupt handling ld (intmk0), 00h ; disable int0 ld (pdfc), 00h ; set pd0 to port ld (pdcr), 00h ; set pd0 to input mode ld (wupmod), 01h ; set wuint0 to "falling or rising edge" ld (wupedge), 01h ; set wuint0 to "rising edge" ld (wupflag), 00h ; clear wuint0 flag ld (inte0ad), 03h ; set int0 interrupt level (as wuint0) to 3 ld (intclr), 0ah ; clear int0 interrupt request flag nop ; wait for 3 cycles nop nop ld (intmk0), 01h ; enable wuint0 ei ; enable interrupt handling
tmp92cd54i 2009-12-26 92cd54i-46 tentative 3.5 port functions the tmp92cd54i has input/output ports listed in table 3.5.1. these port pins are shared pins; they are not only used for general-purpose input/output port functions but also used as internal cpu or i/o function pins. table 3.5.1 port functions port name pin name number of pins i/o i/o setting pin name for built-in function port 0 p00 to p07 8 i/o bit d0 to d7 port 4 p40 to p47 8 i/o bit a0 to a7 p70 1 i/o bit rd p71 1 i/o bit wr p72 1 i/o bit si2/scl2 p73 1 i/o bit cs p74 1 i/o bit port 7 p75 1 i/o bit wait pc0 1 i/o bit ti0 / int1 pc1 1 i/o bit to1 pc2 1 i/o bit to3 / int2 pc3 1 i/o bit ti4 / int3 pc4 1 i/o bit to5 port c pc5 1 i/o bit to7 / int4 pd0 1 i/o bit ti8 / int5 / a16 / wuint0 pd1 1 i/o bit ti9 / int6 / a17 / wuint1 pd2 1 i/o bit to8 / a18 / wuint2 pd3 1 i/o bit to9 / a19 / wuint3 pd4 1 i/o bit tia / int7 / a20 / wuint4 pd5 1 i/o bit tib / a21 / wuint5 pd6 1 i/o bit toa / a22 / wuint6 port d pd7 1 i/o bit tob / a23 / wuint7 pf0 1 i/o bit txd0 pf1 1 i/o bit rxd0 pf2 1 i/o bit sclk0 / cts0 pf3 1 i/o bit txd1 pf4 1 i/o bit rxd1 pf5 1 i/o bit sclk1 / cts1 pf6 1 i/o bit tx port f pf7 1 i/o bit rx port g pg0 to pg7 8 input (fixed) an0 to an7 port l pl0 to pl3 4 input (fixed) an8 to an11 pm0 1 i/o bit ss / a8 pm1 1 i/o bit mosi / a9 pm2 1 i/o bit miso / a10 pm3 1 i/o bit seclk / a11 port m pm4 1 i/o bit sck2 pn0 1 i/o bit sck0 pn1 1 i/o bit so0 / sda0 pn2 1 i/o bit si0 / scl0 pn3 1 i/o bit sck1 / a12 pn4 1 i/o bit so1 / sda1 / a13 pn5 1 i/o bit si1 / scl1 / a14 port n pn6 1 i/o bit so2 / sda2 / a15
tmp92cd54i 2009-12-26 92cd54i-47 tentative 3.5.1 port 0 (p00-p07/d0-d7) port 0 is an 8-bit general-purpose input/ output port for which each bit can be individually specified as input or output. the control register, p0cr, and function register, p0fc, are used to specify input or output. in addition to the general-purpose input/output port function, the pins can also function as a data bus (d0-d7). figure 3.5.1 port0 table 3.5.2 port0 registers symbol name address 7 6 5 4 3 2 1 0 p07 p06 p05 p04 p03 p02 p01 p00 r/w 0 0 0 0 0 0 0 0 p0 port0 00h input/output p07c p06c p05c p04c p03c p02c p01c p00c w 0 0 0 0 0 0 0 0 p0cr port0 control register 02h (no rmw) 0:input 1:output ? ? ? ? ? ? ? p0f w ? ? ? ? ? ? ? 0 p0fc port0 function register 03h (no rmw) 0:port 1:data bus(d7 to d0) p0fc p0cr 0 1 0 input port data bus (d0 to d7) 1 output port data bus (d0 to d7) p0cr register p0fc register p0 register s 0 1 selecto r s 1 0 selecto r port 0 p00 to p07 (d0 to d7) external write strobe external write data port read data external read data external read strobe
tmp92cd54i 2009-12-26 92cd54i-48 tentative 3.5.2 port 4 (p40-p47) port 4 is an 8-bit general-purpose input/ output port for which each bit can be individually specified as input or output. the control register, p4cr, and function register, p4fc, are used to specify input or output. in addition to the general-purpose input/output port function, the pins can also function as an address bus (a0-a7). figure 3.5.2 port4 table 3.5.3 port4 registers symbol name address 7 6 5 4 3 2 1 0 p47 p46 p45 p44 p43 p42 p41 p40 r/w 0 0 0 0 0 0 0 0 p4 port4 10h input/output p47c p46c p45c p44c p43c p42c p41c p40c w 0 0 0 0 0 0 0 0 p4cr port4 control register 12h (no rmw) 0:input 1:output p47f p46f p45f p44f p43f p42f p41f p40f w 0 0 0 0 0 0 0 0 p4fc port4 function register 13h (no rmw) 0:port 1:address bus(a0 to a7) p4fc p4cr 0 1 0 input port address bus (a0 to a7) 1 output port don?t use this setting. p4cr register p4fc register p4 register s 0 1 selector s 1 0 selecto r (reserved) port read data port4 p40 to p47 (a0 to a7) s 0 1 selecto r (reserved) address bus (reserved) (reserved)
tmp92cd54i 2009-12-26 92cd54i-49 tentative 3.5.3 port 7 (p70-p75) port 7 is an 6-bit general-purpose input/ output port for which each bit can be individually specified as input or output. the control register, p7cr, and function register, p7fc, are used to specify input or output. in addition to the general-purpose input/ou tput port function, pins 70, 71 and 73 can also function as read, write strobe and chip select signals respecti vely, pin 72 as an i/o pin for the clock synchronous 8-bit sio or the serial bus interface that operates as an i 2 c bus, and pin 75 as a wait input. the sbi data input (sio), si2, and sbi clock input/output (i 2 c), scl2, are always input-enabled. a reset initializes port pins 70, 71, 73 and 74 to output port mode and pins 72 and 75 to input port mode. figure 3.5.3 port7 (p70 to p72) p72 (si2/scl2) p7cr register p7fc register p7 register s 0 1 selector s 1 0 selecto r s 0 1 selector when pnode register is ?1?, p72 signal is open drain output. port read data (reserved) si/scl input scl output p7 register s 0 1 selector s 1 0 selector port read data p71 ( wr ) write strobe p7cr register p7fc register p7 register s 0 1 selector s 1 0 selector port read data p70 ( rd ) read strobe p7cr register p7fc register
tmp92cd54i 2009-12-26 92cd54i-50 tentative figure 3.5.4 port7 (p73 to p75) p7 register s 0 1 selecto r s 1 0 selecto r p o r t r ead data p73 ( cs ) chip selection p7cr register p7fc register p7 register s 1 0 selector wait re q uest p75 ( wait ) p7cr register p7fc register port read data p7 register s 0 1 selecto r s 1 0 selecto r port read data p74 ( reserved ) p7cr register p7fc register
tmp92cd54i 2009-12-26 92cd54i-51 tentative table 3.5.4 port7 registers symbol name address 7 6 5 4 3 2 1 0 ? ? p75 p74 p73 p72 p71 p70 r/w ? ? 0 1 1 1 1 1 p7 port7 1ch input/output ? ? p75c p74c p73c p72c p71c p70c w ? ? 0 1 1 0 1 1 p7cr port7 control register 1eh (no rmw) 0:input 1:output ? ? p75f p74f p73f p72f p71f p70f w ? ? 0 0 0 0 0 0 p7fc port7 function register 1fh (no rmw) 0:port 1: wait 0:port 0:port 1: cs 0:port 1:si2 scl2 note1 0:port 1: wr 0:port 1: rd p7cr p7fc ? ? p75 p74 p73 p72 p71 p70 0 0 input port input port, si2 input port 1 0 output port 1 1 wait don?t use this setting. cs don?t use this setting. wr rd 0 1 wait don?t use this setting. cs si2, scl2 wr rd note: the scl2 (p72) pin (clock input/output pin for i 2 c mode) can be set to open-drain by setting pnode to 1.
tmp92cd54i 2009-12-26 92cd54i-52 tentative 3.5.4 port c (pc0-pc5) port c is an 6-bit general-purpose input/ output port for which each bit can be individually specified as input or output. the control register, pccr, and function register, pcfc, are used to specify input or output. in addition to the general-purpose input/output port function, the pins can also function as 8-bit timer input/output or interrupt input. timer inputs ti0 and ti4 are always input-enabled except when in idle3 or stop mode. a reset initializes port c to input port mode. figure 3.5.5 portc (pc0 to pc5) pc4 (to5) pc5 (to7/int4) pc register pccr register pcfc register s 0 1 timer output port read data s 1 0 interrupt request 1 0 s 1 0 s 1 0 pc1 (to1) pc2 (to3/int2) pc register pccr register pcfc register (reserved) port read data timer output s interrupt request pc register port read data timer input pc0 (ti0/int1) pc3 (ti4/int3) (reserved) s 1 0 pccr re g ister pcfc register s 1 0 interrupt request
tmp92cd54i 2009-12-26 92cd54i-53 tentative table 3.5.5 portc registers symbol name address 7 6 5 4 3 2 1 0 ? ? pc5 pc4 pc3 pc2 pc1 pc0 r/w ? ? 0 0 0 0 0 0 pc portc 30h input/output ? ? pc5c pc4c pc3c pc2c pc1c pc0c w ? ? 0 0 0 0 0 0 pccr portc control register 32h (no rmw) 0:input 1:output ? ? pc5f pc4f pc3f pc2f pc1f pc0f w ? ? 0 0 0 0 0 0 pcfc portc function register 33h (no rmw) 0:port int4 1:to7 0:port 1:to5 0:port int3 ti4 0:port int2 1:to3 0:port 1:to1 0:port int1 ti0 pccr pcfc ? ? pc5 pc4 pc3 pc2 pc1 pc0 0 0 input port, int4 input port input port, int3, ti4 input port, int2 input port input port, int1, ti0 1 0 output port 1 1 to7 to5 output port to3 to1 output port 0 1 to7 to5 do not use this setting note: do not set :, :, :, and : to "0:1".
tmp92cd54i 2009-12-26 92cd54i-54 tentative 3.5.5 port d (pd0-pd7) port d is an 8-bit general-purpose input/ output port for which each bit can be individually specified as input or output. the control register, pdcr, and function register, pdfc, are used to specify input or output. in addition to the general-purpose input/output port function, the pins can also function as 16-bit timer input/output or interrupt input. timer inputs ti8, ti9, tia, tib and external interrupts int5, int6, and int7 are always input-enabled except when in idle3 or stop mode. wakeup interrupts wuint0 to wuint7 are always input-enabled. a reset initializes port d to input port mode. figure 3.5.6 portd pd2 (to8/a18/wuint2) pd3 (to9/a19/wuint3) pd6 (toa/a22/wuint6) pd7 (tob/a23/wuint7) s 0 1 selector s 1 0 selecto r port read data s 0 1 selector timer output a ddress bus wake up request pdcr register pdfc register pd register pd0 (ti8/int5/a16/wuint0) pd1 (ti9/int6/a17/wuint1) pd4 (tia/int7/a20/wuint4) pd5 (tib/a21/wuint5) pdcr register pdfc register pd register s 0 1 selecto r s 1 0 selecto r address bus port read data wake up request interrupt request timer input
tmp92cd54i 2009-12-26 92cd54i-55 tentative table 3.5.6 portd registers symbol name address 7 6 5 4 3 2 1 0 pd7 pd6 pd5 pd4 pd3 pd2 pd1 pd0 r/w 0 0 0 0 0 0 0 0 pd portd 34h input/output pd7c pd6c pd5c pd4c pd3c pd2c pd1c pd0c w 0 0 0 0 0 0 0 0 pdcr portd control register 36h (no rmw) 0:input 1:output pd7f pd6f pd5f pd4f pd3f pd2f pd1f pd0f w 0 0 0 0 0 0 0 0 pdfc portd function register 37h (no rmw) 0:port wuint 7 1:tob a23 0:port wuint 6 1:toa a22 0:port tib wuint 5 1:a21 0:port tia int7 wuint 4 1:a20 0:port wuint 3 1:to9 a19 0:port wuint 2 1:to8 a18 0:port ti9 int6 wuint 1 1:a17 0:port ti8 int5 wuint 0 1: a16 pdcr pdfc pd7 pd6 pd 5 pd4 pd3 pd2 pd1 pd0 0 0 input port, wuint7 input port, wuint6 input port, tib, wuint5 input port, int7, tia, wuint4 input port, wuint3 input port, wuint2 input port, int6, ti9, wuint1 input port, int5, ti8, wuint0 1 0 output port 1 1 tob toa, tib, wuint5 tia, int7, wuint4 to9 to8 ti9, int6, wuint1 ti8, int5, wuint0 0 1 a23 a22 a21 a20 a19 a18 a17 a16 note 1: ports d0, d1, and d4 are assigned two interrupt sources each (pd0: int5/wuint0, pd1: int6/wuint1, pd4: int7/wuint4). if both interrupt requests are issued when these interrupts are enabled, both are handled. to use only either of the two interrupt sour ces, disable (mask) the other interrupt source using the interrupt mask register or wakeup mask register. note 2: to use any pin shared with an interrupt input as an input/output port pin, ensure that interrupt requests are disabled before setting the pdfc and pdcr registers.
tmp92cd54i 2009-12-26 92cd54i-56 tentative 3.5.6 port f (pf0-pf7) port f is an 8-bit general-purpose input/ output port for which each bit can be individually specified as input or output. the control register, pfcr, and function register, pffc, are used to specify input or output. in addition to the general-purpose input/output port function, the pins can also function as serial interface and contro ller area network (can) pins. serial receive data pins rxd0 and rxd1, can receive data pin rx, clear-to-send pins cts0 and cts1, and serial clock pins sc lk0 and sclk1 are always input-enabled except when in idle3 or stop mode. a reset initializes port f to input port mode. figure 3.5.7 portf (pf0, pf3 and pf6) when pfcr register is ?0? and pffc register is ?1?, txd is open drain output. s 0 1 selector s 1 0 selecto r txd out p ut port read data pf0 (txd0) pf3 (txd1) pfcr register pffc register pf register s 0 1 selector s 1 0 selector tx out p ut port read data pf6 (tx) pfcr register pffc register pf register
tmp92cd54i 2009-12-26 92cd54i-57 tentative figure 3.5.8 portf (pf1, pf4, pf7, pf2 and pf5) port read data rxd input pf register s 1 0 selecto r pf1 (rxd0) pf4 (rxd1) pf7 (rx) pfcr register pffc register pf2 (sclk0/ cts0 ) pf5 (sclk1/ cts1 ) s 0 1 selector s 1 0 selecto r port read data s 0 1 selector sclk output (reserved) sclk input cts input pfcr register pffc register pf register
tmp92cd54i 2009-12-26 92cd54i-58 tentative table 3.5.7 portf registers symbol name address 7 6 5 4 3 2 1 0 pf7 pf6 pf5 pf4 pf3 pf2 pf1 pf0 r/w 0 0 0 0 0 0 0 0 pf portf 3ch input/output pf7c pf6c pf5c pf4c pf3c pf2c pf1c pf0c w 0 0 0 0 0 0 0 0 pfcr portf control register 3eh (no rmw) 0:input 1:output pf7f pf6f pf5f pf4f pf3f pf2f pf1f pf0f w 0 0 0 0 0 0 0 0 pffc portf function register 3fh (no rmw) 0:port 1:rx 0:port 1:tx 0:port cts1 1:sclk1 0:port 1:rxd1 0:port 1:txd1 0:port cts0 1:sclk0 0:port 1:rxd0 0:port 1:txd0 pfcr pffc pf7 pf6 pf5 pf4 pf3 pf2 pf1 pf0 0 0 input port, rx input port input port, sclk1 (input), cts1 input port, rxd1 input port input port, sclk0 (input), cts0 input port, rxd0 input port 1 0 output port 1 1 rx tx sclk1 (output) rxd1 txd1 sclk0 (output) rxd0 txd0 0 1 rx tx don?t use this setting. rxd1 txd1 (open drain) don?t use this setting. rxd0 txd0 (open drain)
tmp92cd54i 2009-12-26 92cd54i-59 tentative 3.5.7 port g (pg0-pg7) port g is an 8-bit genera l-purpose input-only port. in addition to the general-purpose input port function, the pins can also function as a/d converter input pins. a/d conversion inputs an0 to an7 are always input-enabled except when in idle3 or stop mode. figure 3.5.9 portg table 3.5.8 portg register symbol name address 7 6 5 4 3 2 1 0 pg7 pg6 pg5 pg4 pg3 pg2 pg1 pg0 r pg portg 40h input 3.5.8 port l (pl0-pl3) port l is an 4-bit genera l-purpose input-only port. in addition to the general-purpose input port function, the pins can also function as a/d converter input pins. a/d conversion inputs an8 to an11 are always input-enabled except when in idle3 or stop mode. figure 3.5.10 portl table 3.5.9 portl register symbol name address 7 6 5 4 3 2 1 0 ? ? ? ? pl3 pl2 pl1 pl0 r pl portl 54h ? ? ? ? input portl pl0 to pl3 (an8 to an11) port read data ad converter input portg pg0 to pg7 (an0 to an7) port read data ad converter input
tmp92cd54i 2009-12-26 92cd54i-60 tentative 3.5.9 port m (pm0-pm4) port m is an 5-bit general-purpose input/ output port for which each bit can be individually specified as input or output. the control register, pmcr, and function register, pmfc, are used to specify input or output. in addition to the general-purpose input/output port function, the pins can also function as serial general-purpose in terface input/output pins. the slave select pin ss, seri al data transmit/receive pins mosi and miso, sei clock pin seclk, and sbi clock input/output (sio) pin sck2 are always input-enabled except when in idle3 or stop mode. a reset initializes port m to input port mode. figure 3.5.11 portm (pm0 to pm3) s 0 1 selector s 1 0 selecto r address bus port read data pm0 ( ss /a8) ss input pmcr register pmfc register pm register when pmode register is ?1?, pm1 to pm3 signals are open drain output. pm1 (mosi/a9) pm2 (miso/a10) pm3 (seclk/a11) s 0 1 selector s 1 0 selecto r port read data s 0 1 selector address bus mosi input miso input seclk input mosi, miso, seclk output enable sei monito r mosi output miso output seclk output pmcr register pmfc register pm register
tmp92cd54i 2009-12-26 92cd54i-61 tentative figure 3.5.12 portm (pm4) table 3.5.10 portm register symbol name address 7 6 5 4 3 2 1 0 ? ? ? pm4 pm3 pm2 pm1 pm0 r/w ? ? ? 0 0 0 0 0 pm portm 58h input/output ? ? ? ? odem3 odem2 odem1 - r/w ? ? ? ? 0 0 0 - pmode portm open drain enable register 59h p m 3 output 0:cmos 1:open drain pm2 output 0:cmos 1:open drain pm1 output 0:cmos 1:open drain ? ? ? pm4c pm3c pm2c pm1c pm0c w ? ? ? 0 0 0 0 0 pmcr portm control register 5ah (no rmw) 0:input 1:output ? ? ? pm4f pm3f pm2f pm1f pm0f w ? ? ? 0 0 0 0 0 pmfc portm function register 5bh (no rmw) 0:port 1:sck2 0:port 1: seclk a11 0:port 1:miso a10 0:port 1:mosi a9 0:port 1: ss a8 pmcr pmfc ? ? ? pm4 pm3 pm2 pm1 pm0 0 0 ? ? ? input port, sck2 (input) input port input port input port input port, ss 1 0 ? ? ? output port 1 1 ? ? ? sck2 (output) seclk miso mosi ss 0 1 ? ? ? don?t use this setting a11 a10 a9 a8 s 0 1 selector s 1 0 selecto r port read data s 0 1 selector sck output (reserved) sck input pm4 (sck2) pmcr register pmfc register pm register
tmp92cd54i 2009-12-26 92cd54i-62 tentative 3.5.10 port n (pn0-pn6) port n is an 7-bit general-purpose input/ output port for which each bit can be individually specified as input or output. the control register, pncr, and function register, pnfc, are used to specify input or output. in addition to the general-purpose input/output port function, the pins can also function as serial channel input/output pins. the sbi clock input/output (sio) pins sck0 and sck1, sbi data input (sio) pins si0 and si1, sbi clock input/output (i2c) pins scl0 and scl1, and sbi data input/output (i2c) pins sda0 and sda1 are always inpu t-enabled except when in idle3 or stop mode. a reset initializes port n to input port mode. figure 3.5.13 portn pn0 (sck0) pn3 (sck1/a12) s 0 1 selector s 1 0 selecto r port read data s 0 1 selector sck output address bus sck input pncr register pnfc register pn register pn1 (so0/sda0) pn2 (si0/scl0) pn4 (so1/sda1/a13) pn5 (si1/scl1/a14) pn6 (so2/sda2/a15) pncr register pnfc register pn register s 0 1 selector s 1 0 selecto r p o r t r ead data s 0 1 selector so/sda output scl output address bus sda input si/scl input when pnode register is ?1?, pn1, pn2, pn4, pn5 and pn6 signals are open drain output.
tmp92cd54i 2009-12-26 92cd54i-63 tentative table 3.5.11 portn register symbol name address 7 6 5 4 3 2 1 0 ? pn6 pn5 pn4 pn3 pn2 pn1 pn0 r/w ? 0 0 0 0 0 0 0 pn portn 5ch input/output ode72 oden6 oden5 oden4 ? oden2 oden1 ? r/w r/w 0 0 0 0 ? 0 0 ? pnode portn open drain enable register 5dh p72 output 0:cmos 1:open drain pn6 output 0:cmos 1:open drain pn5 output 0:cmos 1:open drain pn4 output 0:cmos 1:open drain pn2 output 0:cmos 1:open drain pn1 output 0:cmos 1:open drain ? pn6c pn5c pn4c pn3c pn2c pn1c pn0c w ? 0 0 0 0 0 0 0 pncr portn control register 5eh (no rmw) 0:input 1:output ? pn6f pn5f pn4f pn3f pn2f pn1f pn0f w ? 0 0 0 0 0 0 0 pnfc portn function register 5fh (no rmw) 0:port 1: so2 sda2 a15 0:port si1 1:scl1 a14 0:port 1:so1 sda1 a13 0:port 1:sck1 a12 0:port si0 1:scl0 0:port 1:so0 sda0 0:port 1:sck0 pncr pnfc ? pn6 pn5 pn4 pn3 pn2 pn1 pn0 0 0 ? input port input port input port input port, sck1 (input) input port, si0 input port input port, sck0 (input) 1 0 ? output port 1 1 ? so2/sda 2 scl1 so1/sda 1 sck1 (output) scl0 so0/sda 0 sck0 (output) 0 1 ? a15 a14 a13 a12 don?t use this setting.
tmp92cd54i 2009-12-26 92cd54i-64 tentative 3.6 memory controller 3.6.1 overview of functions the tmp92cd54i memory cont roller can control a block address space as follows: (1) accessing a block address space in an external area the memory controller can specify a block size and start addre ss for a single block address space allocated in an external area. (2) specifying a memory type the memory controller can specify either sram or rom as the type of memory to be connected to a block address space. (3) specifying a data bus width the data bus width of a block address space is fixed to eight bits. (4) controlling wait states the memory controller can control the number of wait states for exte rnal bus cycles using the wait specification bit in a control register and the wait input pin. it can specify the number of wait states separately for a read cycle and write cycle. the memory controller supports the following five modes to control the number of wait states: 0 wait states, 1 wait state, 2 wait states, 3 wait states, n wait states (controlled using the wait pin) 3.6.2 control registers and operation upon a reset this section describes the register s used to control the memory controller as well as the status upon a reset and ne cessary settings. (1) control registers the following control registers are used for the memory controller: (2) operation upon a reset upon a reset, the block address space is set to addresses 000000h to ffffefh. after a reset has been released, use the memo ry start address regist er (msar) and memory address mask register (mamr) to specify the block address space and configure the control register (bcsl/h). to make the settings effective, set bcsl to 1. 0 wait, 1 wait, 2 wait, 3 wait, n wait (n is controlled with wait pin) control register (bcsh/bcsl: block chip select high/low) ? configures the basic functions of the memory controller, such as the type of memory to be connected and the number of wait states for read and write. memory start addre ss register (msar) ? specifies the start address of the selected block address space. memory address mask register (msmr) ? specifies the block size of the selected block address space.
tmp92cd54i 2009-12-26 92cd54i-65 tentative 3.6.3 basic functions and register settings this section describes the memory controller functions for setting the block address area, memory type, and number of wait states. (1) specifying the block address space clearing bcsh to 0 causes the block address space to be fixed to the range of 000000h to ffffefh with the settings of msar (memory start address register) and mamr (memory address mask register) disabled. setting bcsh to 1 enables the msar and mamr settings, thus allowing the user to specify any block address space. the msar an d mamr specify the st art address and block address space size, respectively. to specify the block address space size, either mask or enable comparison for each bit of the address. the memory controller compares the address with the value in the register in each bus cycle to determ ine whether it is accessing an external memory location. note that any address bits masked with mamr are not compared. if the compared addresses match, the memory controll er pulls the chip select signal ( cs ) low. figure 3.6.1 shows an example of connection between the tmp92cd54i and external memory. in this example, ram is connected via an 8-bit bus. figure 3.6.1 example of connecting external memory (external ram) cs wr rd data ( d0 to d7 ) address tmp92cd54i ram oe we cs
tmp92cd54i 2009-12-26 92cd54i-66 tentative (i) setting the memory st art address register bits ms23 to ms16 in the memory start address register corres pond to address bits a23 to a16, respectively. the start lower address, a15 to a0, are always 0000h. the start address of the block address space can, therefore, be specified within the range from 000000h to ff0000h, in 64-kbyte units. (ii) setting the memory ad dress mask register the memory address mask register specifies whether each bit in the address will be compared or not. the bits cleared to 0 will be compared while those set to 1 will not be compared. bit a23 is always compared. the address bits for the block address space that can be masked are a22 to a15. the following sizes can be specif ied for the block address space: table 3.6.1 block address space size (bytes) cs area 256 512 32 k 64 k 128 k 256 k 512 k 1 m 2 m 4 m 8 m cs note: upon a reset, bcsh is set to 0. the block address space is, therefore, set to addresses 000000h to ffffefh. setting bcsh to 1 enables the start address (msar register) and address space size (mamr register) to be specified. (iii) example register settings to set the block address area 64 kb from a ddress 110000h, set the registers as follows: msb lsb 7 6 5 4 3 2 1 0 msar 0 0 0 1 0 0 0 1 ; set start address to 110000h mamr 0 0 0 0 0 0 0 1 ; set block address area size to 64k-bytes bits ms23 to ms16 in the memory start addre ss register (msar) correspond to address bits a23 to a16, respectively. a15 to a0 are 0. if the value of masr is set as shown above, therefore, the start address of the block address space becomes 110000h. bits mv22 to mv15 in the memory address mask register specify whether bits a22 to a15 will be compared in address comparison. the bi ts cleared to 0 will be compared while those set to 1 will not be compared . bit a23 is always compared. the above settings specify that bits a23 to a 16 will be compared with the value specified as the start address. this results in the 64 -kbyte range of 110000h to 11ffffh being set as the block address space. if the address on the bus is matched, the memory controller drives the chip select signal ( cs ) low.
tmp92cd54i 2009-12-26 92cd54i-67 tentative (iv) if the block overlaps built-in memory space if the specified block address space overlaps the built-in memory space, the block address space will be handled according to the following order of priority: this means that priorities are assigned to prevent collision rather than remapping the block addresses. if any address outside the specified block address space is accessed, the number of wait bus cycles is set to 1 (with the rd and wr signals output but the cs signal not output). it is a fixed parameter. (2) controlling wait states an external bus cycle is completed in two states (100 ns at 20 mhz) at a minimum. the number of wait states for read and write cycles can be specified by setting and in control register bcsl. bww and bwr can be set in the same way, as shown below. table 3.6.2 bww/bwr bit (bcsl regsiter) bww2 bwr2 bww1 bwr1 bww0 bwr0 function 0 0 1 2states (0 wait) access fixed mode 0 1 0 3states (1 wait) access fixed mode (default) 1 0 1 4states (2 wait) access fixed mode 1 1 0 5states (3 wait) access fixed mode 0 1 1 wait pin input mode others (reserved) (i) fixed wait mode in this mode, a bus cycle is always completed in a specified number of states. the number of states can be specified in the range from two states (zero waits) to five states (three waits). (ii) wait pin input mode in this mode, the wait input pin is sampled and wait states are inserted as long as the signal is low. in this mode, a bus cycle requires two states at a minimum. if the wait signal is high in the second state, the bus cycle is co mpleted. a bus cycle may be extended to more than two states as long as the wait signal is low. built-in i/o > built-in memory > block address space
tmp92cd54i 2009-12-26 92cd54i-68 tentative (3) bus access timing ? external read/write bus cycle (0 wait states) ? external read/write bus cycle (1 wait state) figure 3.6.2 external read/write bus cycle (0 and 1 wait status) t1 t2 in p ut output read write address cs rd d7 to 0 wr d7 to 0 clk (20mhz) t1 tw in p ut output t2 read write address cs rd d7 to 0 wr d7 to 0 clk (20mhz)
tmp92cd54i 2009-12-26 92cd54i-69 tentative ? external read/write bus cycle (0 wait states in wait pin input mode) ? external read/write bus cycle (n wait states in wait pin input mode) figure 3.6.3 external read/write bus cycle ( wait pin input mode) t1 t2 in p ut output read write sampling address cs rd d7 to 0 wr d7 to 0 clk (20mhz) wait t1 tw in p ut output read write sampling t2 sampling address cs rd d7 to 0 wr d7 to 0 clk (20mhz) wait
tmp92cd54i 2009-12-26 92cd54i-70 tentative ? example wait input circuit (for 5 wait states) figure 3.6.4 example wait input circuit (for 5 wait status) d q ck res d q ck res dq ck res dq ck res dq ck res wait ff0 ff1 ff2 ff3 ff4 clk cs rd wr ff2 q ff0 d ff0 q ff1 q ff_res ff3 q 12 3 4567 cs rd clk (20mhz) wait
tmp92cd54i 2009-12-26 92cd54i-71 tentative 3.6.4 registers this section summarizes the memory control regi sters and their settings. for the address of each register, refer to chapter 5, "list of special function registers." (1) control registers the memory is controlled with the bcsl and bcsh registers. block cs/wait control register (l) 7 6 5 4 3 2 1 0 bit symbol ? bww2 bww1 bww0 ? bw r2 bwr1 bwr0 read/w rite w af ter r eset ? 0 1 0 ? 0 1 0 : specify the number of write wait states. 001 = 2-state (0-wait) access 010 = 3-state (1-wait) access 101 = 4-state (2-wait) access 110 = 5-state (3-wait) access 011 = wait pin input mode others = (reserv ed) : specify the number of read wait states. 001 = 2-state (0-wait) access 010 = 3-state (1-wait) access 101 = 4-state (2-wait) access 110 = 5-state (3-wait) access 011 = wait pin input mode others = (reserved) block cs/wait control register (h) 7 6 5 4 3 2 1 0 bit symbol be bm ? ? bom1 bom0 bbus1 bbus0 read/w rite w after reset 1 0 0 (fix to 0) 0 (fix to 0) 0 0 0 0 bcsl (0148h) bcsh (0149h) : enable bit 0 = does not output the chip select signal. 1 = outputs the chip select signal (default). : specify block address space. 0 = sets the cs block address space to 000000h-ffffefh (default). 1 = enables the cs block address space to be programmed. note: upon a reset, the cs block address space is set to 000000h-ffffefh. 00 = sram or rom (default) others = (reserved) specify data bus width. 00 = 8 bits (default) others = (reserved) figure 3.6.5 block cs/w ait control register
tmp92cd54i 2009-12-26 92cd54i-72 tentative (2) block address space specification registers the start address and range of the block address space are specified using two registers, memory start address register (msar) and memory a ddress mask register (mamr). memory start address register 7 6 5 4 3 2 1 0 bit symbol ms23 ms22 ms21 ms20 ms19 ms18 ms17 ms16 read/w rite r/w af ter r eset 1 1 1 1 1 1 1 1 : specify start address. these bits specify the start address of each block address space. the bits in this register correspond to address bits a23 to a16. memory address mask register 7 6 5 4 3 2 1 0 bit symbol mv22 mv21 mv20 mv19 mv18 mv17 mv16 mv15 read/w rite r/w af ter reset 1 1 1 1 1 1 1 1 < mv22:15>: these bits specify whether the corresponding address bits will be compared in address comparison. bits mv22 to mv15 correspond to address bits a22 to a15. setting a bit to 0 causes the corresponding bit of the value on the address bus to be compared with the start address bit. setting a bit to 1 causes the bit not to be compared. bit a23 is always compared. msar (014bh) mamr (014ah) figure 3.6.6 memory start addres s/memory address mask registers
tmp92cd54i 2009-12-26 92cd54i-73 tentative 3.7 8-bit timers the tmp92cd54i contains eight channels of 8-bit timers (timers 0 to 7). the timers are grouped into four modules, each consisting of two channels (timer 01, timer 23, timer 45 and timer 67) and can operate in one of the following four modes: ? 8-bit interval timer mode ? 16-bit interval timer mode ? 8-bit programmable square wave (ppg, with va riable cycle and duty ratio) output mode ? 8-bit pulse width modulation (pwm, with fixed cycle and variable duty ratio) output mode figure 3.7.1 to figure 3.7.4 show bloc k diagrams of timers 01, 23, 45 and 67. each channel consists of an 8-bit up-counter , 8-bit comparator and 8-bit timer register. a timer flip-flop and prescaler are provided for each pair of two channels. the timer operating mode and flip-flop are controlled using five special function registers (sfr). four modules (timers 01, 23, 45 and 67) operat e independently of each other. all modules operate in the same way except the differences in specification listed in table 3.7.1. this section only describes the operation of timer 01. table 3.7.1 registers and pins for each module module specification timers 01 timers 23 timers 45 timers 67 input pin for external clock ti0 (shared with pc0) - ti4 (shared with pc3) - external pin output pin for timer flip-flop to1 (shared with pc1) to3 (shared with pc2) to5 (shared with pc4) to7 (shared with pc5) timer run register trun01 (0080h) trun23 (0088h) trun45 (0090h) trun67 (0098h) timer register treg0 (0082h) treg1 (0083h) treg2 (008ah) treg3 (008bh) treg4 (0092h) treg5 (0093h) treg6 (009ah) treg7 (009bh) timer mode register tmod01 (0084h) tmod23 ( 008ch) tmod45 (0094h) tmod67 (009ch) sfr (address) timer flip-flop control register tffcr1 (0085h) tffcr3 (008dh) tffcr5 (0095h) tffcr7 (009dh)
tmp92cd54i 2009-12-26 92cd54i-74 tentative 3.7.1 block diagram for each module figure 3.7.1 timers 01 block diagram timer 1 interrupt output: intt1 match detect run/clear prescale r clock: t0 t0trg external input clock: ti0 tmod01 selector 8-bit up counter (uc0) 8-bit comparator (cp0) match detect register buffer 0 8-bit timer register treg0 trun01 trun01 t1 t4 t16 2 n over flow timer 0 interrupt output: intt0 tmod01 timer 0 match output: t0trg selector t1 t16 t256 internal bus tmod01 tmod01 512 256 128 64 32 16 8 4 2 t1 t4 t16 t256 prescaler trun01 8-bit up-counter (uc1) 8-bit comparator (cp1) trun01 internal bus tmod01 tmod01 (16bit interval timer mode) over flow (for 8-bit ppg mode) 8-bit timer register treg1 timer flip-flop tff1 tffcr1 timer flip-flop output: to1 tmod01
tmp92cd54i 2009-12-26 92cd54i-75 tentative figure 3.7.2 timers 23 block diagram timer 3 interrupt output: intt3 match detect run/clear prescale r clock: t0 t2trg tmod23 selector 8-bit up counter (uc2) 8-bit comparator (cp2) match detect register buffer 2 8-bit timer register treg2 trun23 trun23 t1 t4 t16 2 n over flow timer 2 interrupt output: intt2 tmod23 timer 2 match output: t0trg selector t1 t16 t256 internal bus tmod23 tmod23 512 256 128 64 32 16 8 4 2 t1 t4 t16 t256 prescaler trun23 8-bit up-counter (uc3) 8-bit comparator (cp3) trun23 internal bus tmod23 tmod23 (16bit interval timer mode) over flow (for 8-bit ppg mode) 8-bit timer register treg3 timer flip-flop tff3 tffcr3 timer flip-flop output: to3 tmod23
tmp92cd54i 2009-12-26 92cd54i-76 tentative figure 3.7.3 timers 45 block diagram timer 5 interrupt output: intt5 match detect run/clear prescaler clock: t0 t4trg external input clock: ti4 tmod45 selector 8-bit up counter (uc4) 8-bit comparator (cp4) match detect register buffer 4 8-bit timer register treg4 trun45 trun45 t1 t4 t16 2 n over flow timer 4 interrupt output: intt4 tmod45 timer 4 match output: t4trg selector t1 t16 t256 internal bus tmod45 tmod45 512 256 128 64 32 16 8 4 2 t1 t4 t16 t256 prescaler trun45 8-bit up-counter (uc5) 8-bit comparator (cp5) trun45 internal bus tmod45 tmod45 (16bit interval timer mode) over flow (for 8-bit ppg mode) 8-bit timer register treg5 timer flip-flop tff5 tffcr5 timer flip-flop output: to5 tmod45
tmp92cd54i 2009-12-26 92cd54i-77 tentative figure 3.7.4 timers 67 block diagram timer 1 interrup7 output: intt7 match detect run/clear prescaler clock: t0 t6trg tmod67 selector 8-bit up counter (uc6) 8-bit comparator (cp6) match detect register buffer 6 8-bit timer register treg6 trun67 trun67 t1 t4 t16 2 n over flow timer 6 interrupt output: intt6 tmod67 timer 6 match output: t6trg selector t1 t16 t256 internal bus tmod67 tmod67 512 256 128 64 32 16 8 4 2 t1 t4 t16 t256 prescaler trun67 8-bit up-counter (uc7) 8-bit comparator (cp7) trun67 internal bus tmod67 tmod67 (16bit interval timer mode) over flow (for 8-bit ppg mode) 8-bit timer register treg7 timer flip-flop tff7 tffcr7 timer flip-flop output: to7 tmod67
tmp92cd54i 2009-12-26 92cd54i-78 tentative 3.7.2 description of each circuit (1) prescaler the 9-bit prescaler divides the 1/4 cpu cloc k (fc/4) to generate the input clock for timer 01. the operation of the prescaler can be controlled using trun01 in the timer operation control register. setting trun01 to 1 causes the prescaler to start counting. setting the bit to 0 causes the prescaler to be zero-cleared and stopped. table 3.7.2 prescaler output clock at fc=20mhz output clock interval t1 (8/fc) t4 (32/fc) t16 (128/fc) t256 (2048/fc) 400 ns 1.6 s 6.4 s 102.4 s 0 1 2 3 4 5 6 7 8 9-bit prescaler o s c x1 x2 4 2 (10mhz) (10mhz) 4 2 t0 t1 t4 t16 t256 t2 t8 t32 run/stop & clear trun01 f io (internal i/o clock) cpu clock fc (20mhz) . 4/fc t1 t4 figure 3.7.5 prescaler note: the numbers in parentheses indicate the values at the maximum operating frequency.
tmp92cd54i 2009-12-26 92cd54i-79 tentative (2) up-counters (uc0 and uc1) the up-counters are 8-bit binary counters that increment the count according to the input clock specified with the timer mode register, tmod01. the input clock for uc0 is selected from among an external clock supplied through the ti0 pin and three types of prescaler output clock, t1, t4 and t16, according to the setting of tmod01. the input clock for uc1 depends on the operating mode. in 16-bit timer mode, the overflow output from uc0 is used as the in put clock for uc1. in other modes, the input clock is selected from among input clock t1, t16 and t256 or the timer 0 comparator output (match detection). the up-counters are set to either "stop and clear" or "count up" using trun01 and trun01. upon a reset, the up-counters are cleared and the timer is stopped.
tmp92cd54i 2009-12-26 92cd54i-80 tentative (3) timer registers (treg0 and treg1) a timer register is an 8-bit register that sp ecifies an interval time. if the up-counter value matches the value set in the timer register, the comparator match detection signal is activated. if the timer register is set to 00h, the match signal is activated when the up-counter overflows. treg0 is paired with a register buffer to form a double-buffer configuration. the double buffer is controlled using trun01. the double buffer is disabled if trun01 = 0 and enabled if trun01 = 1. if the double buffer is enabled, data transfer from the register buffer to the timer register takes place when a 2 n overflow occurs in pwm mode or when period comparison results in a match in ppg mode. in timer mode, therefore, the double buffer cannot be used. upon a reset, trun01 is initialized to 0, thus disabling the double buffer. to use the double buffer, first write a value to the timer register and set to 1 before writing a next setting value to the register buffer. figure 3.7.6 shows the configuration of treg0. selector write shift trigger write to treg0 2 n overflow of pwm trun01 up-counter comparator (cp0) timer registers 0 (treg0) register buffers 0 internal bus matching detection in ppg cycle s a b figure 3.7.6 configuration of treg0 note: the timer register and register buffer ar e assigned to the same address. if trun01 = 0, the same number is written to both the register buffer and timer register. if trun01 = 1, the number is only written to the register buffer. the timer registers are located at the following addresses: treg0: 000082h treg1: 000083h treg2: 00008ah treg3: 00008bh treg4: 000092h treg5: 000093h treg6: 00009ah treg7: 00009bh these registers are write-only and cannot be read.
tmp92cd54i 2009-12-26 92cd54i-81 tentative (4) comparator (cp0) the comparator compares the up-counter value with the value set in the timer register and, if they match, clears the up-counter to 0 and issues an interrupt (intt0-1). it also inverts the value of the timer flip-flop if inversion is enabled. (5) timer flip-flop (tff1) the timer flip-flop (tff1) is inverted wi th a match detection signal from the comparator. the timer flip-flop contro l register, tffcr1, enables or disables the inversion of the flip-flop. upon a reset, the values of tff1 and tff0 are initialized to 0. to set tff1 to 1 or 0, write 01 or 10 to tffcr1, respecti vely. writing 00 to these bits inverts the value of tff1 (soft inversion). the value of tff1 can be output through timer output pin to1 (shared with pc1). to output the timer value, it is necessary to first set the port to enable output, using the port c function register (pcfc). tff is inverted when the foll owing conditions are satisfie d, depending on the mode: 8-bit interval timer mode : a match between uc0 and treg0 or a match between uc1 and treg1 (as selected). 16-bit interval timer mode : a matc h between uc0 and treg0 and a match between uc1 and treg1. 8-bit pwm mode : a match between uc0 and treg0 or a 2 n overflow. 8-bit ppg mode : a match between uc0 and treg0 or a match between uc0 and treg1. note: care should be taken when the 8-bit timer is used with a double buffer in pwm or ppg mode. if data in the register buffer is updated immediately before an overflow occurs with a match between the up-counter value and the timer regi ster setting, a signal having a waveform different from the set value may be output. to prevent that problem, in pwm mode, use an overflow interrupt to ensure that the regi ster buffer update is completed more than six cycles (fc x 6) before a next overflow occurs. similarly, when using ppg mode, use a peri od comparison match interrupt to ensure that the register buffer update is completed more than six cycles before a next match in period comparison. example in pwm mode: match between treg0 and uc0 t pwm (pwm period) 2 n overflow interrupt to1 point at which to modify pwm period use an overflow interrupt to rewrite the value of the timer register before a next overflow occurs.
tmp92cd54i 2009-12-26 92cd54i-82 tentative 3.7.3 8-bit timer registers timers 01 operating control register 7 6 5 4 3 2 1 0 bit symbol t0rde - - - i2t01 t01prun t1run t0run read/write r/w r/w after reset 0 - - - 0 0 0 0 function double buffer 0: disable 1: enable idle2 0: stop 1: operate timer run/stop control 0: stop & clear 1: run (count up) 0 stop & clear 1 run (count up) trun01 (0080h) timer run/stop control treg0 double buffer control 0 disable 1 enable i2t01: operation in idle2 mode (for details, see "3.3.2 standby controller") t01prun: prescaler operation t1run: timer 1 operation t0run: timer 0 operation note1: trun01 bits 4 to 6 return undefined values if read. note2: in ppg/pwm mode, should be set to 1 to enable the double buffer. timer 23 operation control register 7 6 5 4 3 2 1 0 bit symbol t2rde - - - i2t23 t23prun t3run t2run read/write r/w r/w after reset 0 - - - 0 0 0 0 function double buffer 0: disable 1: enable idle2 0: stop 1: rung timer run/stop control 0: stop & clear 1: run (count up) trun23 (0088h) timer run/stop control 0 stop & clear 1 run (count up) treg2 double buffer control 0 disable 1 enable i2t23: operation in idle2 mode (for details, see "3.3.2 standby controller") t23prun: prescaler operation t3run: timer 3 operation t2run: timer 2 operation note1: trun23 bits 4 to 6 return undefined values if read. note2: in ppg/pwm mode, should be set to 1 to enable the double buffer. figure 3.7.7 register for 8-bit timers (trun01, trun23)
tmp92cd54i 2009-12-26 92cd54i-83 tentative timer 45 operation control register 7 6 5 4 3 2 1 0 bit symbol t4rde - - - i2t45 t45prun t5run t4run read/write r/w r/w after reset 0 - - - 0 0 0 0 function double buffer 0: disable 1: enable idle2 0: stop 1: operate timer run/stop control 0: stop & clear 1: run (count up) trun45 (0090h) timer run/stop control 0 stop & clear 1 run (count up) treg4 double buffer control 0 disable 1 enable i2t45: operation in idle2 mode (for details, see "3.3.2 standby controller") t45prun: prescaler operation t5run: timer 5 operation t4run: timer 4 operation note1: trun45 bits 4 to 6 return undefined values if read. note2: in ppg/pwm mode, should be set to 1 to enable the double buffer. timer 67 operation control register 7 6 5 4 3 2 1 0 bit symbol t6rde - - - i2t67 t67prun t7run t6run read/write r/w r/w after reset 0 - - - 0 0 0 0 function double buffer 0: disable 1: enable idle2 0: stop 1: operate timer run/stop control 0: stop & clear 1: run (count up) trun67 (0098h) timer run/stop control 0 stop & clear 1 run (count up) treg6 double buffer control 0 disable 1 enalbe i2t67: operation in idle2 mode (for details, see "3.3.2 standby controller") t67prun: prescaler operation t7run: timer 7 operation t6run: timer 6 operation note1: trun67 bits 4 to 6 return undefined values if read. note2: in ppg/pwm mode, should be set to 1 to enable the double buffer. figure 3.7.8 register for 8-bit timers (trun45, trun67)
tmp92cd54i 2009-12-26 92cd54i-84 tentative timer 01 mode register 7 6 5 4 3 2 1 0 bit symbol t01m1 t01m0 pwm01 pwm00 t1clk1 t1clk0 t0clk1 t0clk0 read/write r/w after reset 0 0 0 0 0 0 0 0 function operation mode 00: 8-bit timer mode 01: 16-bit timer mode 10: 8-bit ppg mode 11: 8-bit pwm mode pwm cycle 00: reserved 01: 2 6 10: 2 7 11: 2 8 source clock for timer 1 00: t0trg 01: t1 10: t16 11: t256 source clock for timer 0 00: ti0 pin (note) 01: t1 10: t4 11: t16 00 ti0 (external input) 01 t1 (prescaler) 10 t4 (prescaler) 11 t16 (prescaler) tmod01 01 tmod01 = 01 00 comparator output from timer 0 01 t1 10 t16 11 t256 overflow output from timer 0 (16-bit timer mode) 00 reserved 01 2 6 clock source 10 2 7 clock source 11 2 8 clock source 00 two 8-bit timers 01 16-bit timer 10 8-bit ppg 11 8-bit pwm (timer 0) + 8-bit timer (timer 1) note : to set the ti0 pin, first set port c and then set tmod01. pwm cycle selection tmod01 (0084h) timer 0 source clock selection timer 1 source clock selection timers 01 operation mode selection figure 3.7.9 register for 8-bit timers (tmod01)
tmp92cd54i 2009-12-26 92cd54i-85 tentative timer 23 mode register 7 6 5 4 3 2 1 0 bit symbol t23m1 t23m0 pwm21 pwm20 t3clk1 t3clk0 t2clk1 t2clk0 read/write r/w after reset 0 0 0 0 0 0 0 0 function operation mode 00: 8-bit timer mode 01: 16-bit timer mode 10: 8-bit ppg mode 11: 8-bit pwm mode pwm cycle 00: reserved 01: 2 6 10: 2 7 11: 2 8 source clock for timer 3 00: t2trg 01: t1 10: t16 11: t256 source clock for timer 2 00: reserved 01: t1 10: t4 11: t16 00 do not set 01 t1 (prescaler) 10 t4 (prescaler) 11 t16 (prescaler) tmod23 01 tmod23 = 01 00 comparator output from timer 2 01 t1 10 t16 11 t256 overflow output from timer 2 (16-bit timer mode) 00 reserved 01 2 6 clock source 10 2 7 clock source 11 2 8 clock source 00 two 8-bit timers 01 16-bit timer 10 8-bit ppg 11 8-bit pwm (timer 2) + 8-bit timer (timer 3) pwm cycle selection tmod23 (008ch) timer 2 source clock selection timer 3 source clock selection timers 23 operation mode selection figure 3.7.10 register for 8-bit timers (tmod23)
tmp92cd54i 2009-12-26 92cd54i-86 tentative timer 45 mode register 7 6 5 4 3 2 1 0 bit symbol t45m1 t45m0 pwm41 pwm40 t5clk1 t5clk0 t4clk1 t4clk0 read/write r/w after reset 0 0 0 0 0 0 0 0 function operation mode 00: 8-bit timer mode 01: 16-bit timer mode 10: 8-bit ppg mode 11: 8-bit pwm mode pwm cycle 00: reserved 01: 2 6 10: 2 7 11: 2 8 source clock for timer 5 00: t4trg 01: t1 10: t16 11: t256 source clock for timer 4 00: ti4 pin (note) 01: t1 10: t4 11: t16 00 ti4 (external input) 01 t1 (prescaler) 10 t4 (prescaler) 11 t16 (prescaler) tmod45 01 tmod45 = 01 00 comparator output from timer 4 01 t1 10 t16 11 t256 overflow output from timer 4 (16-bit timer mode) 00 reserved 01 2 6 clock source 10 2 7 clock source 11 2 8 clock source 00 two 8-bit timers 01 16-bit timer 10 8-bit ppg 11 8-bit pwm (timer 4) + 8-bit timer (timer 5) note : to set the ti4 pin, first set port c and then set tmod45. pwm cycle tmod45 (0094h) source clock for timer 4 source clock for timer 5 operation mode for timers 45 figure 3.7.11 register for 8-bit timers (tmod45)
tmp92cd54i 2009-12-26 92cd54i-87 tentative timer 67 mode register 7 6 5 4 3 2 1 0 bit symbol t67m1 t67m0 pwm61 pwm60 t7clk1 t7clk0 t6clk1 t6clk0 read/write r/w after reset 0 0 0 0 0 0 0 0 function operation mode 00: 8-bit timer mode 01: 16-bit timer mode 10: 8-bit ppg mode 11: 8-bit pwm mode pwm cycle 00: reserved 01: 2 6 10: 2 7 11: 2 8 source clock for timer 7 00: t6trg 01: t1 10: t16 11: t256 source clock for timer6 00: reserved 01: t1 10: t4 11: t16 00 do not set 01 t1 (prescaler) 10 t4 (prescaler) 11 t16 (prescaler) tmod67 01 tmod67 = 01 00 comparator output from timer 6 01 t1 10 t16 11 t256 overflow output from timer 6 (16-bit timer mode 00 reserved 01 2 6 clock source 10 2 7 clock source 11 2 8 clock source 00 two 8-bit timers 01 16-bit timer 10 8-bit ppg 11 8-bit pwm (timer 6) + 8-bit timer (timer 7) pwm cycle tmod67 (009ch) source clock for timer 6 source clock for timer 7 operation mode for timers 67 figure 3.7.12 register for 8-bit timers (tmod67)
tmp92cd54i 2009-12-26 92cd54i-88 tentative timer 1 flip-flop control register 7 6 5 4 3 2 1 0 bit symbol - - - - tff1c1 tff1c0 tff1ie tff1is read/write r/w after reset - - - - 1 1 0 0 function 00: invert tff1 01: set tff1 10: clear tff1 11: don?t care tff1 control for inversion 0: disable 1: enable tff1 inversion select 0: timer 0 1: timer 1 0 inversion by timer 0 1 inversion by timer 1 0 disabled 1 enabled 00 inverts the value of tff1 01 sets tff1 to 1 10 clears tff1 to 0 11 don?t care control of tff1 tffcr1 (0085h) inverse signal for timer flop-flop 1 (tff1) (don?t care except in 8-bit timer mode) inversion of tff1 note: tffcr1 bits 4 to 7 return undefined values if read. read- modify- write not allowed figure 3.7.13 register for 8-bit timers (tffcr1)
tmp92cd54i 2009-12-26 92cd54i-89 tentative timer 3 flip-flop control register 7 6 5 4 3 2 1 0 bit symbol - - - - tff3c1 tff3c0 tff3ie tff3is read/write r/w after reset - - - - 1 1 0 0 function 00: invert tff3 01: set tff3 10: clear tff3 11: don?t care tff3 control for inversion 0: disable 1: enable tff3 inversion select 0: timer 2 1: timer 3 0 inversion by timer 2 1 inversion by timer 3 0 disabled 1 enabled 00 inverts the value of tff3 01 sets tff3 to 1 10 clears tff3 to 0 11 don?t care control of tff3 tffcr3 (008dh) inverse signal for timer flip-flop 3 (tff3) (don?t care except in 8-bit timer mode) inversion of tff3 note: tffcr3 bits 4 to 7 return undefined values if read. read- modify- write not allowed figure 3.7.14 register for 8-bit timers (tffcr3)
tmp92cd54i 2009-12-26 92cd54i-90 tentative timer 5 flip-flop control register 7 6 5 4 3 2 1 0 bit symbol - - - - tff5c1 tff5c0 tff5ie tff5is read/write r/w after reset - - - - 1 1 0 0 function 00: invert tff5 01: set tff5 10: clear tff5 11: don?t care tff5 control for inversion 0: disable 1: enable tff5 inversion select 0: timer 4 1: timer 5 0 inversion by timer 4 1 inversion by timer 5 0 disabled 1 enabled 00 inverts the value tff5 01 sets tff5 to 1 10 clears tff5 to 0 11 don?t care control of tff5 tffcr5 (0095h) inverse signal for timer flip-flop 5 (tff5) (don?t care except in 8-bit timer mode) inversion of tff5 note: tffcr5 bits 4 to 7 return undefined values if read. read- modify- write not allowed figure 3.7.15 register for 8-bit timers (tffcr5)
tmp92cd54i 2009-12-26 92cd54i-91 tentative timer 7 flip-flop control register 7 6 5 4 3 2 1 0 bit symbol - - - - tff7c1 tff7c0 tff7ie tff7is read/write r/w after reset - - - - 1 1 0 0 function 00: invert tff7 01: set tff7 10: clear tff7 11: don?t care tff7 control for invertsion 0: disable 1: enable tff7 inversion select 0: timer 6 1: timer 7 0 inversion by timer 6 1 inversion by timer 7 0 disabled 1 enabled 00 inverts the value of tff7 01 sets tff7 to 1 10 clears tff7 to 0 11 don?t care control of tff7 tffcr7 (009dh) inverse signal for timer flip-flop 7 (tff7) (don?t care except in 8-bit timer mode) inversion of tff7 note: tffcr7 bits 4 to 7 return undefined values if read. read- modify- write not allowed figure 3.7.16 register for 8-bit timers (tffcr7)
tmp92cd54i 2009-12-26 92cd54i-92 tentative timer registers (treg 0 to 7) symbol address 7 6 5 4 3 2 1 0 - w treg0 82h (no rmw) undefined - w treg1 83h (no rmw) undefined - w treg2 8ah (no rmw) undefined - w treg3 8bh (no rmw) undefined - w treg4 92h (no rmw) undefined - w treg5 93h (no rmw) undefined - w treg6 9ah (no rmw) undefined - w treg7 9bh (no rmw) undefined note: the treg registers are used for the comparator. a match between uc and treg causes a match detection signal to be generated. see examples in "3.7.4 operation in each mode." figure 3.7.17 register for 8-bit timers (treg0~treg7)
tmp92cd54i 2009-12-26 92cd54i-93 tentative 3.7.4 operation in each mode (1) 8-bit timer mode each of timers 0 and 1 can be used as an independent 8-bit interval timer. a. generating interrupts at regu lar intervals (u sing timer 1) to use timer 1 to generate timer 1 interrupts (intt1) at regular intervals, first stop timer 1 and then set the operating mode, input clock and interval in tmod01 and treg1. next, enable intt1 and then start counting with timer 1. example: to generate intt1 interrupts every 40 s when fc = 20 mhz, set the registers in the following order: msb lsb 7 6 5 4 3210 trun01 ? x x x ??0? stop timer 1 and clear it to zero. tmod01 0 0 x x 01-- select 8-bit timer mode and set the input clock to t1 (0.4- s resolution, at fc = 20 mhz). treg1 0 1 1 0 0100 set treg1 to 40 s t1 = 100 = 64h. intet01 x 1 0 1 ???? enable intt1 and set the interrupt level to 5. trun01 ? x x x ?11? start counting with timer 1. x = don't care " ? " = no change see table 3.7.3 for how to select the input clock. table 3.7.3 selecting interrupt interval and the input clock using 8-bit timer input clock interrupt interval (at fc = 20 mhz) resolution t1 (8/fc) t4 (32/fc) t16 (128/fc) t256 (2048/fc) 0.4 s to 102.4 s 1.6 s to 409.6 s 6.4 s to 1.639 ms 102.4 s to 26.22 ms 0.4 s 1.6 s 6.4 s 102.4 s note: the available input clocks for timer 0 and timer 1 differ as follows: timer 0: timer 0 input (ti0), t1, t4, or t16 timer 1: timer 0 match detection signal (t0trg), t1, t16, or t256 uc1 & treg1 match detect intt1 interru p t re q uest occu r treg1 = 64h = 40 s t1
tmp92cd54i 2009-12-26 92cd54i-94 tentative b. outputting a square wave of 50% duty ratio invert the value of the timer flip-flop ( tff1) at regular intervals and output the inverted value to the timer flip-flop output pin (to1). example: to output a square wave having a period of 2.4 s when fc = 20 mhz, set the registers in the following order. either timer 0 or timer 1 can be used for that purpose. the example uses timer 1. 7 6 5 4 3210 trun01 ? x x x ??0? stop timer 1 and clear it to zero. tmod01 0 0 x x 01?? select 8-bit timer mode and set the input clock to t1 (0.4 s, at fc = 20 mhz). treg1 0 0 0 0 0011 set treg1 to 2.4 s t1 2 = 3. tffcr1 x x x x 1011 clear tff1 to 0 and set it to be inverted with a match detection signal from timer 1. pccr x x ? ? ??1? pcfc x x ? ? -?1- set pc1 to the to1 output pin. trun01 ? x x x ?11? start counting with timer 1. x = don't care " ? " = no change 0.77 s at @fc = 20 bit7 2 t1 intt1 uc1 clea r tff1 bit 0 bit 1 trun01 up- counter comparator timing comparator output (match detect) to1 0 1 1 1 2 2 2 3 3 3 0 00 figure 3.7.18 square wave output timing chart (50% duty)
tmp92cd54i 2009-12-26 92cd54i-95 tentative c. incrementing the timer 1 count with a match output from timer 0 select 8-bit timer mode and set the input cl ock for timer 1 to the timer 0 comparator output. figure 3.7.19 timer 1 count up on signal from timer 0 (2) 16-bit timer mode a pair of timers 0 and 1 can be used as a 16-bit interval timer. setting tmod01 to 01 selects 16-bit timer mode. in 16-bit timer mode, an overflow output fr om timer 0 is used as the input clock for timer 1 regardless of the value of tmod01. for details of relationship between the timer (interrupt) interval and input clock, see table 3.7.3. the lower eight bits of the timer interrupt interval are specified with timer register treg0 and the upper eight bits with treg1. ensure that treg0 is always set first because a write to treg0 causes comparison to be temporarily disabled, after which a write to treg1 starts comparison. figure 3.7.20 block diagram of 16-bit interval timer mode timer 1 up-counter (when treg1 = 2) timer 0 up-counter (when treg0 = 5) 1 2 3 4 5 1 1 22 33 45 1 2 1 comparator output (timer 0 match) timer 1 match output trun01 internal bus t1 t4 t16 tmod01 selector 8-bit up-counter (uc0) comparator treg0 register buffer comparator treg1 overflow 8-bit up-counter (uc1) intt1 inversion tff1 tffcr1 to1 clea r clea r
tmp92cd54i 2009-12-26 92cd54i-96 tentative example: to generate intt1 interrupts every 0.4 se cond when fc = 20 mhz, set the following values in timer registers treg0 and treg1: if t16 (6.4 s at 20 mhz) is counted as the input clock: 0.4 s 6.4 s = 62500 = f424h therefore, set treg0 = 24h and treg1 = f4h. the timer 0 comparator outputs a match dete ction signal every time up-counter uc0 matches treg0 but uc0 is not cleared at that time. the timer 1 comparator outputs a match detection signal at every comparison timing where up-counter uc1 matches treg1. if bo th timers 0 and 1 output match detection signals simultaneously, up-c ounters uc0 and uc1 are cleared to zero and an intt1 interrupt occurs. the value of timer flip-flop tff1 is also inverted if inversion is enabled. example: when treg1 = 04h and treg0 = 80h: figure 3.7.21 timer output by 16-bit interval timer mode (3) 8-bit ppg (programmable square wave) output mode timer 0 can be used to output a square wave having any specified frequency and duty ratio. either low-active or high-active output pulses can be selected. in this mode, timer 1 is disabled. the square wave is ou tput through to1 (shared with pc1). figure 3.7.22 8 bit ppg output waveforms 0080h 0180h 0280h 0380h 0480h value of up-counter(uc1, uc0): uc0 & treg0 match detect signal 0000h inversion interrupt intt1 timer output to1 uc1 & treg1 match detect signal t t h t l treg0 and uc0 match (interrupt intt0) treg0 treg1 treg1 and uc0 match ( interru p ut intt1 ) to1 dut y c y cle period
tmp92cd54i 2009-12-26 92cd54i-97 tentative in this mode, 8-bit up-counter uc0 inverts the timer output every time its value matches the value in timer register treg0 or treg1 to output a programmable square wave. the value of treg0 must be smaller than that of treg1. in this mode, the up-counter for timer 1, uc1, cannot be used. timer 1 must, however, be set to the counting st ate by setting trun01 to 1. figure 3.7.23 shows a block diagram of this mode: selector t1 shift trigger t4 t16 trun01 8-bit up-counter (uc0) comparator comparator treg0 register buffer trun01 treg1 internal bus tff1 intt0 intt1 inversion tmod01 selector tffcr1 treg0-wr to1 figure 3.7.23 block diagram of 8-bit ppg output mode in this mode, if the double buffer for treg0 is enabled, the value of the register buffer is shifted into treg0 when treg1 and uc0 match. using the double buffer facilitates processing for a small duty ratio (if the duty ratio is varied). q 3 shift from register buffer match with treg0 and up-counte r match with treg1 treg0 (value to be compared) register buffe r (up-counter = q 1 ) q 1 treg0 (register buffer) write (up-countner = q 2 ) q 2 q 2 figure 3.7.24 operation of register buffer
tmp92cd54i 2009-12-26 92cd54i-98 tentative example: outputting pulses having a duty rati o of 1/4 at 62.5 khz (when fc = 20 mhz) 16 s calculate the value to set in the timer register, as follows: to obtain a frequency of 62.5 khz, create a waveform having a period of t = 1/62.5 khz = 16 s. t1 = 0.4 s (at 20 mhz): 16 s 0.4 s = 40 therefore, treg1 = 40 = 28h. next, to obtain a duty ratio of 1/4, using t x 1/4 = 16 s x 1/4 = 4 s: 4 s 0.4 s = 10 therefore, treg0 = 10 = 0ah. 7 6 5 4 3210 trun01 0 x x x ?000 stop timers 0 and 1 and clear them to zero. tmod01 1 0 x x xx01 select 8-bit ppg mode and set the input clock to t1. treg0 0 0 0 0 1010 write 0ah. treg1 0 0 1 0 1000 write 28h. tffcr1 x x x x 011x set tff1 and enable inversion. setting 10 results in a negative-logic output waveform. pccr x x ? ? ??1? pcfc x x ? ? -?1- set pc1 to the to1 pin. trun01 1 x x x ?111 enable double buffer and start counting with timers 0 and 1. x = don't care " ? " = no change
tmp92cd54i 2009-12-26 92cd54i-99 tentative (4) 8-bit pwm output mode this mode is supported only for timer 0. in this mode, a pwm signal having a resolution of up to eight bits can be ou tput. the pwm signal is output through to1 (shared with pc1). in this mode, timer 1 can be output as an 8-bit timer. the timer output is inverted when the up-counter (uc0) value matches the value set in the timer register (treg0) or when the 2 n counter overflows (n = 6, 7 or 8, as specified with tmod01). uc0 is cleared when the 2 n counter overflows. the following conditions must be satisfied to use pwm mode: (treg0 setting) < (2 n counter overflow setting) (treg0 setting) 0 to1 2 n overflo w (intt0 interrupt) t pwm (pwm cycle) treg0 and uc0 match figure 3.7.25 8-bit pwm waveforms figure 3.7.26 shows a block diagram of this mode: tmod01 tffcr1 internal bus shift trigger clear 8-bit up counter (uc0) trun01 selector t1 t4 t16 taff1 to1 comparator treg0 register buffer selector trun01 invert treg0-wr intt0 tmod01 overflow 2 n overflow control figure 3.7.26 block diagram of 8-bit pwm mode
tmp92cd54i 2009-12-26 92cd54i-100 tentative in this mode, if the double buffer for treg0 is enabled, the value of the register buffer is shifted into treg0 when an 2 n overflow is detected. using the double buffer facilitates pr ocessing for a small duty ratio. q 2 up-counter = q 2 up-counter = q 1 q 1 q 2 q 3 shift into treg0 match with treg0 2 n overflo w treg0 (value to be compared) register buffe r treg0 (register buffer) write figure 3.7.27 register buffer operation example: using timer 0 to output the following pwm waveform through the to1 pin (fc = 20 mhz) 36.0 s 51.2 s to obtain a pwm period of 51.2 s with t1 = 0.4 s (at fc = 20 mhz): 51.2 s 0.4 s = 2 n = 128 therefore, set n to 7. since the low-level period is 36.0 s, set treg0 to the following value when t1 = 0.4 s: 36.0 s 0.4 s = 90 = 5ah msb lsb 7 6 5 4 3210 trun01 ? x x x ???0 stop timer 0 and clear it to zero. tmod01 1 1 1 0 ??01 select 8-bit pwm mode (period = 2 7 ) and set the input clock to ? 1. treg0 0 1 0 1 1010 write 5ah. tffcr1 x x x x 101x clear tff1 and enable inversion. pccr x x ? ? ??1? pcfc x x ? ? -?1- set pc1 to the to1 pin. trun01 1 x x x ?1-1 enable double buffer and start counting with timer 0. x = don't care " ? " = no change
tmp92cd54i 2009-12-26 92cd54i-101 tentative table 3.7.4 pwm cycle pwm interval (at fc = 20mhz) t1 t4 t16 2 6 25.6 s ( 39.06 khz ) 102.4 s ( 9.77 khz ) 409.6 s ( 2.44 khz ) 2 7 51.3 s ( 19.53 khz ) 204.8 s ( 4.88 khz ) 819.2 s ( 1.22 khz ) 2 8 102.4 s ( 9.77 khz ) 409.6 s ( 2.44 khz ) 1.6384 ms ( 0.61 khz ) (5) settings for each timer mode table 3.7.5 shows the sfr settings for each mode. table 3.7.5 interval timer mode setting registers register name tmod01 tffcr1 function interval ti mer mode pwm cycle upper timer input clock lower timer input clock timer f/f invert signal select 8-bit timer 2 channels 00 ? lower timer match, t1, t16, t256 (00, 01, 10, 11) external clock, t1, t4, t16 (00, 01, 10, 11) 0: lower timer output 1: upper timer output 16-bit interval timer mode 01 ? ? external clock, t1, t4, t16 (00, 01, 10, 11) ? 8-bit ppg 1 channel 10 ? ? external clock, t1, t4, t16 (00, 01, 10, 11) ? 8-bit pwm 1 channel 11 2 6 , 2 7 , 2 8 (01, 10, 11) ? external clock, t1, t4, t16 (00, 01, 10, 11) ? 8-bit timer 1 channel 11 ? t1, t16 , t256 (01, 10, 11) ? output disabled " ? " = don't care
tmp92cd54i 2009-12-26 92cd54i-102 tentative 3.8 16-bit timers/event counters the tmp92cd54i contains two channels of 16- bit timers/event counters (timer 8 and timer a), which can operate in the following modes: ? 16-bit interval timer mode ? 16-bit event counter mode ? 16-bit programmable square wave (ppg) output mode the following operating modes are also supported by using the capture function: ? frequency measurement mode ? pulse width measurement mode ? time difference measurement mode figure 3.8.1 and figure 3.8.2 show block diagrams of timers 8 and a. each channel mainly consists of a 16-bit up-counter, two 16-bit timer registers (one with double-buffer configurat ion), two 16-bit capture registers, two comparators, a capture input controller, timer flip-flops and their controller. each timer is controlled with 11 register (sfr) bytes. the two channels, timer 8 and timer a, operate independently of each other. both channels operate in the same way except the differences in specification listed in table 3.8.1. this section only describes the operation of timer 8. table 3.8.1 differences between timer 8 and timer a channel specification timer 8 timer a ti8 (also used as pd0) tia (also used as pd4) external clock / capture trigger input pins ti9 (also used as pd1) tib (also used as pd5) to8 (also used as pd2) toa (also used as pd6) external pins timer flip-flop output pins to9 (also used as pd3) tob (also used as pd7) timer run register trun8 (00a0h) truna (00b0h) timer mode register tmod8 (00a2h) tmoda (00b2h) timer flip-flop control register tffcr8 (00a3h) tffcra (00b3h) treg8l (00a8h) tregal (00b8h) treg8h (00a9h) tregah (00b9h) treg9l (00aah) tregbl (00bah) timer register treg9h (00abh) tregbh (00bbh) cap8l (00ach) capal (00bch) cap8h (00adh) capah (00bdh) cap9l (00aeh) capbl (00beh) sfr (address) capture register cap9h (00afh) capbh (00bfh)
tmp92cd54i 2009-12-26 92cd54i-103 tentative 3.8.1 block diagram intenal data bus internal data bus run/ clear match detection 16-bit comparator (cp8) 16-bit up counter (uc8) 16-bit time register treg9h/l match detection count clock tmod8 trun8 slelector capture, external int input control tmod8 prescaler clock: t0 external int input int5 int6 tff1 ti8 ti9 t1 t4 t16 trun8 tmod8 (from timer 01) capture register 8 cap8h/l tmod8 caputure register 9 cap9h/l 32 16 8 4 2 t1 t4 t16 trun8 internal data-bus internal data bus timer flip-flop control tff8 tff9 timer flip-flop to8 to9 over flow int intto8 timer flip-flop output register 0 inttr8 register 1 inttr9 int output 16-bit comparator (cp9) 16-bit timer register treg8h/l register buffer 8 figure 3.8.1 block diagram of timer 8
tmp92cd54i 2009-12-26 92cd54i-104 tentative intenal data bus internal data bus run/ clear match detection 16-bit comparator (cpa) 16-bit up-counter (uca) 16-bit time register tregbh/l match detection count clock tmoda tb0run slelector capture, external int input control tmoda prescaler clock : t0 external int input int7 tff1 ti a tib t1 t4 t16 truna tmoda (from timer 01) capture register a capah/l t moda caputure register b capbh/l 32 16 8 4 2 t1 t4 t16 truna internal data bus internal data bus timer flip-flop control tffa tffb timer flip-flop toa tob over flow int inttoa timer flip-flop output register 0 inttra register 1 inttrb int output 16-bit comparator (cpb) 16-bit timer register tregah/l register buffer a figure 3.8.2 block diagram of timer a
tmp92cd54i 2009-12-26 92cd54i-105 tentative 3.8.2 operation of each circuit (1) prescaler a 5-bit prescaler provides a clock source for timer 8. the input clock for the prescaler, t0, is obtained by dividing fc by four. the trun8 bit enables or stops the prescaler operation. a write of 1 to the bit causes the prescaler to start counting and a write of 0 causes it to be cleared and stopped. table 3.8.2 shows the resolutions of prescaler output clocks. table 3.8.2 prescaler clock resolution at fc=20mhz output clock interval t1 ( 8/fc) t4 ( 32/fc) t16 (128/fc) 0.4 s 1.6 s 102.4 s (2) up-counter (uc8) the up-counter is a 16-bit binary counter according to the input clock specified with tmod8 . the input clock can be selected from among t1, t4, t16 and an external clock on the ti8 pin. the trun8 bit controls counting, stopping and clearing the counter. the up-counter, uc8, is cleared to zero when its value matches the timer register, treg9h/l, if clearing is enabled. the tmod8 bit is used to enable or disable clearing. if clearing is disabled, the counter operates as a free-running counter. if an overflow occurs in uc8, an overflow interrupt (intto8) is generated.
tmp92cd54i 2009-12-26 92cd54i-106 tentative (3) timer registers (treg8h/l and treg9h/l) these two 16-bit registers are used to frequencies specify a comparator match detection signal is output if the value in up-counter uc8 matches that in the timer register. to set data in 16-bit timer registers treg8h/l and treg9h/l, use a 2-byte data transfer instruction or use two 1-byte data transfer instructions to set the lower eight bits and then the upper eight bits. the treg8 timer register ha s a double-buffer configurat ion and is paired with register buffer 8. the double buffer can be enabled or disabled using the timer 8 control register. the double buffer is disabled if the register bit is set to 0 and enabled if it is set to 1. when the double buffer is enabled, a data transfer from the register buffer to the timer register takes place if the value in the up-counter (uc8) matches the value in the timer register (treg9). upon a reset, the values in treg8 an d treg9 are undefined. to use the 16-bit timer, therefore, it is necessary to first write data to the registers. upon a reset, trun8 is initialized to 0, thus disabling the double buffer. to use the double buffer, first write data to the timer register and set trun8 to 1 before writing next data to the register buffer. the treg8 and register buffer are assigned to the same address, 0000a8h / 0000a9h. if trun8 = 0, the same value is written to both treg8 and register buffer. if trun8 = 1, the value is only written to the register buffer. the timer registers are located at the following addresses: upper 8 bits lower 8 bits treg8 0000a9h 0000a8h upper 8 bits lower 8 bits treg9 0000abh 0000aah timer 8 upper 8 bits lower 8 bits trega 0000b9h 0000b8h upper 8 bits lower 8 bits tregb 0000bbh 0000bah timer a the timer registers are write-only. they cannot be read using a program. figure 3.8.3 address of timer registers
tmp92cd54i 2009-12-26 92cd54i-107 tentative (4) capture registers (cap8h/l and cap9h/l) the capture registers are 16-bit registers that latch the value of uc8. to read data from a capture register, use a 2-byte data transfer instruction or use two 1-byte data transfer instructions to read the lower eight bits and then the upper eight bits. the capture registers are located at the following addresses: upper 8 bits lower 8 bits cap8 0000adh 0000ach upper 8 bits lower 8 bits cap9 0000afh 0000aeh timer 8 upper 8 bits lower 8 bits capa 0000bdh 0000bch upper 8 bits lower 8 bits capb 0000bfh 0000beh timer a the capture registers are read-only. they cannot be written using a program. figure 3.8.4 address of cature registers (5) capture input and external interrupt control this circuit controls the timing for latching the value of up-counter uc8 into capture register cap8 and the generation external interrupt int5. the tmod8 bits specify the capture register interrupt timing and external interrupt edge selection. (external in terrupt int6 is fixed to the rising edge.) the prescaler must be set to the run state (trun8 = 1). the value of up-counter uc8 can also be latched into the capture register using software (software capture). by software capture, writing a 0 to tmod8 causes the current value of uc8 to be captured into capture register cap8. (6) comparators (cp8 and cp9) the 16-bit comparators compare the value in uc8 with the values set in treg8 and treg9 to detect a match. upon the detection of a match, they ge nerate inttr8 and inttr9, respectively. (7) timer flip-flops (tff8 and tff9) the timer flip-flops (tff8 and tff9) are in verted with a match detection signal from the comparator or a ca pture register latch signal. inversion triggers for tff8 and tff9 can be controlled using tffcr8 and tmod8, respectively. upon a reset, the values in tff8 and tff9 are undefined. writing 00 to and triggers the inversion of the flip-flop. writing 01 causes the flip-flop to be set to 1 while writing 10 causes it to be cleared to 0. the values of tff8 and tff9 can be output through timer output pins to8 (shared with pd2) and to9 (shared with pd3). to ou tput the timer value, it is necessary to first set the port to enable output, using the port d sfr.
tmp92cd54i 2009-12-26 92cd54i-108 tentative 3.8.3 16-bit timer registers timer 8 operation control register 7 6 5 4 3 2 1 0 bit symbol t8rde - - - i2t8 t8prun - t8run read/write r/w r/w r/w r/w r/w after reset 0 0 - - 0 0 - 0 function double buffer 0: disable 1: enable write 0 idle2 0: stop 1: operate timer run/stop control 0: stop & clear 1: run (count up) trun8 (00a0h) count operation 0 stop and clear 1 count i2t8: operation in idle2 mode (for details, see "3.3.2 standby controller") t8prun: prescaler operation note: trun8 bits 1, 4, and 5 return undefined values if read. t8run: timer 8 operation timer a operation control register 7 6 5 4 3 2 1 0 bit symbol tarde - - - i2ta taprun - tarun read/write r/w r/w r/w r/w r/w after reset 0 0 - - 0 0 - 0 function double buffer 0: disable 1: enable write 0 idle2 0: stop 1: operate 16 bit timer run/stop control 0: stop & clear 1: run (count up) truna (00b0h) count operation 0 stop and clear 1 count i2ta: operation in idle2 mode (for details, see "3.3.2 standby controller") taprun: prescaler operation note: truna bits 1, 4, and 5 return undefined va lues if read. tarun: timer 8 operation figure 3.8.5 registers for 16-bit timers (trun8, truna)
tmp92cd54i 2009-12-26 92cd54i-109 tentative timer 8 mode register 7 6 5 4 3 2 1 0 bit symbol cap9t9 eq9t9 cap8in cap89m1 cap89m0 t8cle t8clk1 t8clk0 read/write r/w w r/w after reset 0 0 1 0 0 0 0 0 tff9 inversion 0: disable trigger 1: enable trigger function invert when the uc value is captured to cap9. invert when the uc value matches the value in treg9. execute software capture 0: execute 1: don?t care note) always read as 1. capture timing 00: disable int5 occurs on ti8 rising edge. 01: cap8:ti8 cap9:ti9 int5 occurs on ti8 rising edge. 10: cap8:ti8 cap9:ti8 int5 occurs on ti8 falling edge. 11: cap8: tff1 cap9: tff1 int5 occurs on ti8 rising edge. control up-counter 0: disable clearing 1: enable clearing timer 8 source clock 00: ti8 pin 01: t1 10: t4 11: t16 timer 8 source clock 00 ti8 pin 01 t1 10 t4 11 t16 up-counter (uc8) clear control 0 disable 1 enable clearing by match with treg9. capture/interrupt timing capture control int5 control 00 disable 01 cap8 at ti8 rise cap9 at ti9 rise int5 occurs on rising edge of ti8. 10 cap8 at ti8 rise cap9 at ti8 fall int5 occurs on falling edge of ti8. 11 cap8 at tff1 rise cap9 at tff1 fall int5 occurs on rising edge of ti8. software capture 0 the value in the up-counter is captured to cap8. 1 don?t care tmod8 (00a2h) figure 3.8.6 registers for 16-bit timers (tmod8)
tmp92cd54i 2009-12-26 92cd54i-110 tentative timer a mode register 7 6 5 4 3 2 1 0 bit symbol capbtb eqbtb capain capabm1 capabm0 tacle taclk1 taclk0 read/write r/w w r/w after reset 0 0 1 0 0 0 0 0 tffb inversion 0: disable trigger 1: enable trigger function invert when the uc value is captured to capb. invert when the uc value matches the value in tregb. execute software capture 0: execute 1: don?t care note) always read as 1. capture timing 00: disable int7 occurs on tia rising edge. 01: capa:tia capb:tib int7 occurs on tia rising edge. 10: capa:tia capb:tia int7 occurs on tia falling edge. 11: capa: tffa capb: tffa int7 occurs on tia rising edge. control up-counter 0: disable clearing 1: enable clearing timer a source clock 00: tia pin 01: t1 10: t4 11: t16 timer a source clock 00 tia pin 01 t1 10 t4 11 t16 up-counter clear control 0 disable 1 enable clearing on match with tregb. capture/interrupt timing capture control int7 control 00 disable 01 capa at tia rise capb at tib rise int7 occurs on rising edge of tia. 10 capa at tia rise capb at tia fall int7 occurs on falling edge of tia. 11 capa at tff1 rise capb at tff1 fall int7 occurs on rising edge of tia. software capture 0 the value in the up-counter is captured to capa. 1 don?t care tmoda (00b2h) figure 3.8.7 registers for 16-bit timers (tmoda)
tmp92cd54i 2009-12-26 92cd54i-111 tentative timer 8 flip-flop control register 7 6 5 4 3 2 1 0 bit symbol tff9c1 tff9c0 cap9t8 cap8t8 eq9t8 eq8t8 tff8c1 tff8c0 read/write w r/w w after reset 1 1 0 0 0 0 1 1 tff8 inversion trigger 0: disable trigger 1: enable trigger function control tff9 00: invert 01: set 10: clear 11: don?t care note)always read as 11 invert when the uc value is loaded in to cap9. invert when the uc value is loaded in to cap8. invert when the uc value matches the value in treg9. invert when the uc value matches the value in treg8. control tff8 00: invert 01: set 10: clear 11: don?t care note)always read as 11 00 invert 01 set to 1 10 clear to 0 11 don?t care 0 disable trigger 1 enable trigger 0 disable trigger 1 enable trigger 0 disable trigger 1 enable trigger 0 disable trigger 1 enable trigger 00 invert 01 set to 1 10 clear to 0 11 don?t care tffcr8 (00a3h) tff8 control tff8 inverted when the uc value is matched to treg8. tff8 inverted when the uc value is matched to treg9. tff8 inverted when the uc value is loaded to cap8. tff8 inverted when the uc value is loaded to cap9. tff9 control figure 3.8.8 registers for 16-bit timers (tffcr8)
tmp92cd54i 2009-12-26 92cd54i-112 tentative timer a flip-flop control register 7 6 5 4 3 2 1 0 bit symbol tffbc1 tffbc0 capbta capata eqbta eqata tffac1 tffac0 read/write w r/w w after reset 1 1 0 0 0 0 1 1 tffa inversion trigger 0: disable trigger 1: enable trigger function control tffb 00: invert 01: set 10: clear 11: don?t care note)always read as 11 invert when the uc value is loaded in to capb. invert when the uc value is loaded in to capa. invert when the uc value matches the value in tregb. invert when the uc value matches the value in trega. control tffa 00: invert 01: set 10: clear 11: don?t care note)always read as 11 00 invert 01 set to 1 10 clear to 0 11 don?t care 0 disable trigger 1 enable trigger 0 disable trigger 1 enable trigger 0 disable trigger 1 enable trigger 0 disable trigger 1 enable trigger 00 invert 01 set to 1 10 clear to 0 11 don?t care tffcra (00b3h) tffa control tffa inverted when the uc value matches to trega. tffa inverted when the uc value matches to tregb. tffa inverted when the uc value is loaded to capa. tffa inverted when the uc va lue is loaded to capb. tffb control figure 3.8.9 registers for 16-bit timers (tffcra)
tmp92cd54i 2009-12-26 92cd54i-113 tentative timer registers (timer 8 and timer a) symbol address 7 6 5 4 3 2 1 0 - w treg8l a8h (no rmw) undefined - w treg8h a9h (no rmw) undefined - w treg9l aah (no rmw) undefined - w treg9h abh (no rmw) undefined - w tregal b8h (no rmw) undefined - w tregah b9h (no rmw) undefined - w tregbl bah (no rmw) undefined - w tregbh bbh (no rmw) undefined capture registers (timer 8 and timer a) symbol address 7 6 5 4 3 2 1 0 - r cap8l ach undefined - r cap8h adh undefined - r cap9l aeh undefined - r cap9h afh undefined - r capal bch undefined - r capah bdh undefined - r capbl beh undefined - r capbh bfh undefined figure 3.8.10 registers for 16-bit timers. (treg8 to b (l/h), cap8 to b (l/h))
tmp92cd54i 2009-12-26 92cd54i-114 tentative 3.8.4 operation in each mode (1) 16-bit interval timer mode generating interrupts at regular intervals set an interval time in timer register treg9 to generate an inttr9 interrupt. 7 6 5 4 3210 trun8 0 0 x x ?0x0 stop timer 8. intet89 x 1 0 0 x000 enable inttr9, set the level to 4, and disable inttr8. tffcr8 1 1 0 0 0011 disable trigger. tmod8 0 0 1 0 01** set the input clock to the prescaler output clock and (** = 01, 10, 11) disable the capture function. treg9 * * * * **** set an interval time (16 bits). * * * * **** trun8 0 0 x x ?1x1 start timer 8. x = don't care " ? " = no change (2) 16-bit event counter mode the 16-bit timer can function as an even t counter by using an external clock (supplied on the ti8 pin) as the input clock. the up-counter is incremented on the rising edge of the ti8 pin input. the count value can be obtained by performing a software capture and then reading the captured value. 7 6 5 4 3210 trun8 0 0 x x ?0x0 stop timer 8. pdcr ? ? ? ? ???1 pdfc - - - - ---1 set pd0 to ti8. intet89 x 1 0 0 x000 enable inttr9, set the level to 4, and disable inttr8. tffcr8 1 1 0 0 0011 disable trigger. tmod8 0 0 1 0 0100 set the input clock to the ti8 pin input. treg9 * * * * **** set the count value (16 bits). * * * * **** trun8 0 0 x x ?1x1 start timer 8. x = don't care "-" = no change note: the prescaler must also be set to "run" mode (trun8 = "1") when the timer is used as an event counter.
tmp92cd54i 2009-12-26 92cd54i-115 tentative (3) 16-bit ppg (programmable square wave) output mode in this mode, the timer can be used to ou tput a square wave having any specified frequency and duty ratio (programmable square wave). either low-active or high-active output pulses can be selected. the inversion of timer flip-flop tff8 is triggered with a match between uc8 and the timer register (treg8 and treg9) setting, resulting in a programmable square wave being output through the to8 pin. the values of treg8 and treg9 must satisfy the following condition: (treg8 value) < (treg9 value) figure 3.8.11 programmable pulse generation (ppg) output waveforms in this mode, if the double buffer for treg8 is enabled, the value of register buffer 8 is shifted into treg8 upon a match with treg9. using the double buffer facilitates processing for a small duty ratio. figure 3.8.12 operation of register buffer match with treg8 (inttr8 inerrupt) match with treg9 (inttr9 interrupt) to8 pin q 1 q 2 q 2 q 3 shift into thetreg9 up-counter = q 1 up-counter = q 2 match with treg8 match with treg9 treg8 (value to be compared) register buffe r write into the treg8
tmp92cd54i 2009-12-26 92cd54i-116 tentative the following shows a block diagram of this mode: figure 3.8.13 block diagram of 16-bit ppg output mode in 16-bit ppg output mode, set the registers as follows: 7 6 5 4 3210 trun8 0 0 x x ?0x0 disable treg8 double buffer and stop timer 8. treg8 * * * * **** set a duty ratio (16 bits). * * * * **** treg9 * * * * **** set a frequency (16 bits). * * * * **** trun8 1 0 x x ?0x0 enable treg8 double buffer. (duty ratio/frequency modified with an inttr9 interrupt) tffcr8 x x 0 0 1110 set tff8 to invert upon detection of a match with treg8 and treg9. initialize tff8 to 0. tmod8 0 0 1 0 01** set the input clock to the prescaler output clock and (** = 01, 10, 11) disable the capture function. pdcr ? ? ? ? ?1?? pdfc ? ? - - ?1-- assign to8 to the pd2 pin. trun8 1 0 x x ?1x1 start timer 8. x = don't care; ? ? ? = no change selector selector trun8 match 16-bit up-counter uc8 f/f (tff8) 16-bit comparator internal bus treg9 treg8-wr ti8 t1 t4 t16 to8 (ppg output) trun8 clear register buffer 8 treg8 16-bit comparator
tmp92cd54i 2009-12-26 92cd54i-117 tentative (4) examples using the capture function the capture function can be used for ma ny applications, including the following examples: a. one-shot pulse output from external trigger pulse b. frequency measurement c. pulse width measurement d. time difference measurement a. one-shot pulse output from external trigger pulse operate up-counter uc8 in free-running mode using the prescaler output clock. supply external trigger pulses through the ti8 pin and use the capture function to latch the up-counter value into capture register cap8 on the rising edge of a trigger pulse. an int5 interrupt occurs on the rising edge of an external trigger pulse. in int5 interrupt handling, se t timer register treg8 with the sum (c + d) of the cap8 value (c) and delay time (d). for timer register treg9, set the sum (c + d + p) of the treg8 value (c + d) and the width of the one-shot pulse (p). (that is, treg8 = c + d and treg9 = c + d + p.) in addition, set to 11 to enable a trigger so that timer flip-flop tff8 will be inverted upon a match between uc8 and treg8 as well as a match between uc8 and treg9. once a one-shot pulse has been output, use the inttr9 interrupt handling to redisable a trigger. the symbols (c), (d), and (p) in the abov e description correspon d to symbols c, d, and p in figure 3.8.14, "one-shot pulse output from an external trigger pulse (with delay)." figure 3.8.14 one-shot pulse output (with delay) timer output pin to8 c + d + p c + d c disables inversion caused by loading of the up-counter value into cap8. inversion enable (p) (d) pulse width delay time inversion enable inttr9 occurred load the up-counter value into capture register (cap8) and int5 occurred count clock (internal clock) set the counter in free-running mode. ti8 pin input (external trigger pulse) match with treg8 match with treg9
tmp92cd54i 2009-12-26 92cd54i-118 tentative example settings: outputting a one-shot pulse of 2 ms with a 3-ms delay using an external trigger pulse on the ti8 pin main settings set the counter to free-running mode. start counting with t1. tmod8 x x 1 0 1001 capture into cap8 on the rising edge of ti8 input. tffcr8 x x 0 0 0010 clear tff8 to zero. disable tff8 inversion. pdcr ? ? ? ? ?1?? pdfc ? ? - - ?1-- assign to8 to pd2. inte56 x ? ? ? x100 enable int5, set the level to 4, and intet89 x 0 0 0 x000 disable inttr8 and inttr9. trun8 ? 0 x x ?1x1 start timer 8. setting of int5 treg8 cap8 + 3 ms/ t1 treg9 treg8 + 2 ms/ t1 tffcr8 x x ? ? 11?? enable tff8 inversion upon a match with treg8 and treg9. intet89 x 1 0 0 x??? enable inttr9. setting inttr9 tffcr8 x x ? ? 00?? disable tff8 inversion upon a match with treg8 and treg9. intet89 x 0 0 0 x??? disable inttr9. x = don't care; ? ? ? = no change if a delay time is not necessary, invert timer flip-flop tff8 when the counter value is captured into cap8 and use an int5 inte rrupt to set timer register treg9 with the sum (c + p) of the cap8 value (c) and the one-shot pulse width (p). enable tff8 so that it will be inverted upon a match between treg9 and uc8. and upon an inttr9 interrupt, redisable tff8.
tmp92cd54i 2009-12-26 92cd54i-119 tentative figure 3.8.15 one-shot pulse output (without delay) b. frequency measurement in this mode, the timer is used to meas ure the frequency of an external clock. supply an external clock through the ti8 pin and measure it using 8-bit timers (timers 0 and 1) and a 16-bit timer/event counter (timer 8). set the timer 8 input clock to the ti8 input and set tmod8 to 11. capture the value of up-counter uc8 into cap8 on th e rising edge of timer flip-flop tff1 for the 8-bit timers (timers 0 and 1) and into cap9 on its falling edge. use 8-bit timer interrupts (intt0 and intt1) to obtain the frequency from the difference between the values in capture registers cap8 and cap9. figure 3.8.16 frequency measurement for example, if the tff1 "1" level width is set to 0.5 s with the 8-bit timers and the difference between cap8 and cap9 is 100, then the frequency is 100 0.5 s = 200 hz. c + p c inversion enable (p) pulse width load the up-counter value into capture register (cap8). int5 occurred count clock (internal clock) ti8 pin input (external trigger pulse) match with treg9 timer output to8 load the up-counter value into capture register (cap9) inttr9 occurred enables inversion caused by loading of the up-counter value into cap8. disables incersioncaus ed by loading of the up-counter value into cap9. c9 c8 c9 c8 c9 c8 count clock (ti8 input clock) tff1 loading uc into cap8 loading uc into cap9 intt0/intt1
tmp92cd54i 2009-12-26 92cd54i-120 tentative c. pulse width measurement in this mode, the timer is used to measure the high-level width of an external pulse. supply an external pulse through the ti8 pin and operate the 16-bit timer/event counter in free-running mode using the internal clock. use the capture function to trigger capturing on both the rising and falling edges of an external pulse to capture the value of the up-counter (uc8) into capture registers cap8 and cap9. an int5 interrupt occurs on the falling edge of the ti8 pin input. the pulse width can be determined from the difference between cap8 and cap9 and the period of the internal clock. for example, if the prescaler output clock period is 0.8 s and the difference between cap8 and cap9 is 100, then the pulse width is 100 x 0.8 [ s] = 80 [ s]. software-based processing is necessary if the pulse width to be measured exceeds the maximum count time for uc8. figure 3.8.17 pulse width measurement note: only in pulse width measurement mode (tmod8 = 10), an int5 external interrupt occurs on the falling edge of the ti8 input. it occurs on the rising edge in all other modes. to measure the low-level width, multiply the period of the prescaler output clock by the difference between the first c9 value and the second c8 value in the int5 interrupt handling. c9 c8 c9 c8 c9 c8 c ount c l oc k (internal clock) ti8 p i n (external pulse) loading uc into cap8 int5 loading uc into cap9
tmp92cd54i 2009-12-26 92cd54i-121 tentative d. time difference measurement in this mode, the timer is used to me asure the time difference between the rising edges of an external pulse input on the ti8 and ti9 pins. operate the 16-bit timer/event counter (timer 8) in fr ee-running mode using the internal clock and capture the value of up-counter uc8 into capture register cap8 on the rising edge of the ti8 input, at which time an int5 interrupt occurs. similarly, capture the value of up-counter uc8 into capture register cap9 on the rising edge of the ti9 input, at which time an int6 interrupt occurs. once the values have been captured into the capture registers, the time difference can be determined by multiplyin g the period of the internal clock by the difference between cap9 and cap8. figure 3.8.18 time difference measurement time digerence c9 c8 ti8 pin input ti9 pin input int5 loading uc into cap8 int6 loading uc into cap9 count clock (internal clock)
tmp92cd54i 2009-12-26 92cd54i-122 tentative 3.9 serial channels the tmp92cd54i contains two serial input/output channels. both channels support uart mode (asynchronous communication) and i/o in terface mode (synchronous communication). in mode 1 and mode 2, a parity bit can be adde d. in mode 3, a wakeup function is supported for the master controller to activate the slave controller in a serial link system. figure 3.9.2 and figure 3.9.3 show block diagrams for each channel. serial channels 0 and 1 operate independently of each other. both channels operate in the same way except the differences in specification listed in table 3.9.1. this section only describes the operation of channel 0. table 3.9.1 differences between channels 0 to 1 channel 0 channel 1 pin name txd0 (pf0) rxd0 (pf1) 0cts /sclk0 (pf2) txd1 (pf3) rxd1 (pf4) cts1 /sclk1 (pf5) figure 3.9.1 data formats ? i/o interface mode mode 0: transmits and receives i/o data and its synchronization signal (sclk) for expanding i/o. ? uart mode mode 1: transmits/receives 7-bit data. mode 2: transmits/receives 8-bit data. mode 3: transmits/receives 9-bit data. bit 0 1 2 3 4 5 6 start stop bit 0 1 2 3 4 5 6 start stop parity bit 0 1 2 3 4 5 6 bit 0 1 2 3 4 5 6 start stop start stop parity 7 7 7 bit 0 1 2 3 4 5 6 start 8 7 stop bit 0 1 2 3 4 5 6 start stop (wake-up) bit 8 7 when bit 8 = 1, an address (select code) is denoted. when bit 8 = 0, data is denoted. ? mode 0 (i/o interface mode) transfer direction ? mode 1 (7-bit uart mode) ? mode 2 (8-bit uart mode) ? mode 3 (9-bit uart mode) no parity parity no parity parity 7 bit 0 1 2 3 4 5 6
tmp92cd54i 2009-12-26 92cd54i-123 tentative 3.9.1 block diagram for each channel prescaler br0cr t0trg (from timer 0) 16 32 64 8 4 2 t2 t8 t32 t0 br0cr br0add selector selector selector prescaler t0 t2 t8 t32 br0cr 1(f c /2) i/o interface mode 2 selector sc0cr sc0mod0 receive counter (uart only 16) serial channel interrupt control transmision counter (uart only 16) transmission control receive control receive buffer1 (shift register) rb8 receive buffer2 (sc0buf) error flag sioclk uart mode sc0mod0 sc0mod0 tb8 transmission buffer int request intrx0 inttx0 sc0cr 0 cts shared with pf2 sc0mod0 rxd0 shared with pf1 sc0cr txdclk sc0mod0 parity control serial clock generation circuit sclk0 shared with pf2 sclk0 shared with pf2 baud rate generator rxdclk txd0 shared with pf0 internal bus i/o interface mode figure 3.9.2 block diagram of the serial channel 0
tmp92cd54i 2009-12-26 92cd54i-124 tentative prescaler br1cr t0trg (from timer 0) 16 32 64 8 4 2 t2 t8 t32 t0 br1cr br1add selector selector selector prescaler t0 t2 t8 t32 br1cr 1(f c /2) i/o interface mode 2 selector i/o interface mode sc1cr sc1mod0 receive counter (uart only 16) serial channel interrupt control transmision counter (uart only 16) transmission control receive control receive buffer1 (shift register) rb8 receive buffer2 (sc1buf) error flag sioclk uart mode sc1mod0 sc1mod0 tb8 transmission buffer int request intrx1 inttx1 sc1cr 1 cts shared with pf5 sc1mod0 rxd1 shared with pf4 sc1cr txdclk sc1mod0 parity control serial clock generation circuit sclk1 shared with pf5 sclk1 shared with pf5 baud rate generator rxdclk txd1 shared with pf3 internal bus figure 3.9.3 block diagram of the serial channel 1
tmp92cd54i 2009-12-26 92cd54i-125 tentative 3.9.2 operation of each circuit (1) prescaler the 6-bit prescaler divides the 1/4 system cl ock (fc/4) to generate the input clock for the baud rate generator. the br0cr bits in the baud rate generator control register specify the input clock from the prescaler. table 3.9.2 shows the resolutions of prescaler output clocks. table 3.9.2 prescaler clock resolution to baud rate generator at fc=20mhz output clock clock resolution t0 ( 4/fc) 0.2 s t2 ( 16/fc) 0.8 s t8 ( 64/fc) 3.2 s t32 (256/fc) 12.8 s the baud rate generator uses one of four prescaler output clocks, t0, t2, t8 and t32. figure 3.9.4 6-bit prescaler x1 x2 4 2 (10mhz) (10mhz) 4 2 t0 t2 t8 t32 f io f io (internal i/o clock) system clock fc (20mhz) osc 0 1 2 3 4 5 6-bit prescaler
tmp92cd54i 2009-12-26 92cd54i-126 tentative (2) baud rate generator the baud rate generator generates a transmit/receive clock that defines the transfer speed on a serial channel. the clock input to the baud rate generator is generated with the 6-bit prescaler from t0, t2, t8, or t32. the br0cr bits in the baud rate generator control register specify the input clock. the baud rate generator contains a frequency divider that can divide the clock by n (n = 1 to 16) or n + (16 - k)/16 (n = 2 to 15 and k = 1 to 15). note that specifying division by n causes the (16 - k)/16 portion to be disabled. division by n setting division by n + (16 - k)/16 setting k n ? 1 2 ? 15 1 1 do not use this setting 2 2 2+1/16 2+2/16 ? 2+15/16 3 3 3+1/16 3+2/16 ? 3+15/16 4 4 4+1/16 4+2/16 ? 4+15/16 5 : : : ? : 14 14 14+1/16 14+2/16 ? 14+15/16 15 15 15+1/16 15+2/16 ? 15+15/16 so the overall division can take any value in the range [1; n+(16-k)/16; 16] with n = 2, 3, ?, 15 and k = 1, 2, ?, 15. the transfer rate is determined from th e settings of br0cr and br0add. br0cr: division by n + (16 - k)/16 0: disabled 1: enabled br0cr: set division ratio 0000: n = 16 (cannot be used when division by n + (16 - k)/ 16 is enabled) 0001: n= 1 0010: n= 2 : : 1111: n=15 br0add: set division ratio k (w hen division by n + (16 - k)/16 is enabled) 0000: disabled 0001: k=1 : : 1111: k=15 ? in uart mode (1) when br0cr = 0 the setting of br0add is ignored and the frequency is divided by n as specified with br0ck (n = 1, 2, 3 ... 16). (2) when br0cr = 1 division by n + (16 - k)/16 is enabled. the frequency is divided by n + (16 - k)/16 according to n specified with br0cr (n = 2, 3 ... 15) and k
tmp92cd54i 2009-12-26 92cd54i-127 tentative specified with br0add (k = 1, 2, 3 ... 15). note: if n = 1 or 16, division by n + (16 - k)/16 is disabled and br0cr must be set to 0. ? in i/o interface mode in i/o interface mode, division by n + (16 - k)/16 cannot be used. always set br0cr to 0 to perform division by n. the following shows how to calculate the baud rate when using the baud rate generator: ? uart mode baud rate = 16 ? i/o interface mode baud rate = 16 ? division by an integer (n) the baud rate in uart mode is calculat ed as follows when fc = 19.6608 mhz, the input clock is t2 (frequency: fc/16), division value n (br0cr) = 8, and br0cr = 0: baud rate = 16 = 19.6608 10 6 16 8 16 = 9600 (bps) note: the setting of br0add is ig nored for division by an integer because division by n + (16 - k)/16 is disabled. ? division by n + (16 - k)/16 (in uart mode only) the baud rate is calculated as follows when fc = 15.9744 mhz, the input clock is t2 (frequency: fc/16), division value n ( br0cr) = 6, k (br0add) = 8, and br0cr = 1: baud rate = 16 = 15.9744 10 6 16 (6 + 8/16) 16 = 9600 (bps) table 3.9.3 and table 3.9.4 show example baud rates in uart mode. an external clock input can also be used as the serial clock. the following shows how to calculate the baud rate in that case: ? uart mode baud rate = external clock input frequency 16 the external clock input frequency must be less than or equal to fc/4. ? i/o interface mode baud rate = external clock input frequency the external clock input frequency must be less than or equal to fc/16. baud rate generator input clock frequency baud rate generator frequency division value fc/16 8 fc/16 6 + (16 ? 8)/16 baud rate generator input clock frequency baud rate generator frequency division value
tmp92cd54i 2009-12-26 92cd54i-128 tentative table 3.9.3 selection of transfer rate (1) (when using the baud rate generator with br0cr = 0) fc [mhz] input clock frequency divider t0 (4/fc) t2 (16/fc) t8 (64/fc) t32 (256/fc) 18.432000 15 19.200 4.800 1.200 0.300 8 38.400 9.600 2.400 0.600 19.660800 16 19.200 4.800 1.200 0.300 note: in i/o interface mode, the transfer rate is eight times the value shown in the table. table 3.9.4 selection of transfer rate (2) (when using timer 0 input clock t1) fc treg0 20 mhz 19.6608 mhz 16 mhz 02h 76.8 62.5 04h 38.4 31.25 05h 31.25 08h 19.2 10h 9.6 how to calculate the baud rate (when using timer 0) note: in i/o interface mode, a match signal from timer 0 cannot be used as a transfer clock. unit: kbps unit: kbps transfer rate = fc treg0 8 16 ( when the timer 0 in p ut clock is t1 )
tmp92cd54i 2009-12-26 92cd54i-129 tentative (3) serial clock generator this circuit generates a basic clock for transmitting and receiving data. ? in uart mode the sc0mod0 register selects the cl ock to be used to generate the basic clock, sioclk, from the baud rate generator, internal clock 1 (fc/2), a match detection signal from timer 0, or an external clock (sclk0). ? in i/o interface mode in sclk output mode (sc0cr = 0), the frequency of the baud rate generator output is divided by two to generate the basic clock. in sclk input mode (sc0cr = 1), the basic clock is generated by detecting the rising or falling edge, as specified with the sc0cr register. (4) receive counter the receive counter is a 4-bit binary counter used in uart mode that increments with sioclk. a bit of data is received using 16 sioclk cycles and data is sampled in the seventh, eighth, and ninth clock cycles. the received data is determined based on majority rule using three samples. for example, if data is sampled as 1, 0, and 1 in the seventh, eighth, and ninth clock cycles, respectively, the received data is determ ined to be 1. if the sampled data is 0, 0, and 1, the received data is determined to be 0. (5) receive controller ? in i/o interface mode in sclk output mode (sc0cr = 0), the rxd0 pin is sampled on the rising edge of the shift clock output to the sclk0 pin. in sclk input mode (sc0cr = 1), the rxd0 pin is sampled on the rising or falling edge of the sclk0 pin input, depending on the sc 0cr setting. ? in uart mode the receive controller has a start bit detector based on majority rule. if at least two of the three samples are 0, the controller determines that the start bit is valid and starts receiving data. it also determines received data based on majority rule duri ng data reception.
tmp92cd54i 2009-12-26 92cd54i-130 tentative (6) receive buffer the receive buffer has double-buffer structure to prevent an overrun error. received data is stored in receive buffer 1 (shift register) one bit at a time. once seven or eight bits have been stored, the data is moved to the other buffer, receive buffer 2 (sc0buf), at which time an intrx0 interrupt occurs. the cpu only reads data from receive buffer 2 (sc0buf). data received next can be stored in receive buffer 1 before the cpu reads the received data from receive buffer 2 (sc0buf). an overrun error o ccurs, however, if the cpu does not read data from receive buffer 2 (sc0buf) before all bits of next data are stored in receive buffer 1. if an overrun error occurs, the contents of receive buffer 2 and sc0cr are maintained but those of receive buffer 1 are lost. the parity bit when a parity is added to 8- bit uart data or the most significant bit in 9-bit uart mode is stored in sc0cr. in 9-bit uart mode, setting sc0mod to 1 enables slave controller wakeup operation and an intrx0 interrupt occurs only if sc0cr = 1. (7) transmit counter the transmit counter is a 4-bit binary co unter used in uart mode. it is also counted with sioclk and generates a transmit clock, txdclk, once every 16 clock cycles. siocl k txdcl k 15 16 12 456 78910 11 12 13 14 15 16 3 1 2 figure 3.9.5 generation of the transmission clock (8) transmit controller ? in i/o interface mode in sclk output mode (sc0cr = 0), the data in the transmit buffer is output to the txd0 pin, one bit at a time, on the rising edge of the shift clock output through the sclk0 pin. in sclk input mode (sc0cr = 1), the data in the transmit buffer is output to the txd0 pin, one bit at a time, on the rising or falling edge of the sclk input, depending on the sc 0cr setting. ? in uart mode once the cpu writes transmit data to the transmit buffer, the transmit controller starts transmission on the next rising edge of txdclk.
tmp92cd54i 2009-12-26 92cd54i-131 tentative handshaking serial channels 0 and 1 have the cts pins, which enable transmission in frame units, thus preventing an overrun error. this function can be disabled or enabled using sc0mod0. if the 0cts pin is driven high during transmission, the transmitter completes the transmission of the data currently being tr ansmitted and then stop transmission until the 0cts pin is driven back low. an inttx0 interrupt, however, occurs, with which the transmit controller requests next transmit data from the cpu, writes the data to the transmit buffer and then waits until transmission is ready. the tmp92cd54i does not have a dedica ted rts pin. any single port can be assigned to the rts function. once the receiver completes receiving data (in the rxd interrupt routine), it can drive the assigned rts port high to request the transmitter to suspend transmission, thus ea sily implementing handshaking. figure 3.9.6 handshake function note 1: if the cts signal is driven high during transmis sion, next data transmission stops upon the completion of the current transmission. note 2: transmission starts on the first fa lling edge of the txdclk clock after the cts signal falls. figure 3.9.7 cts (clear to send) timing rxd rts (any port) receiver txd cts 92cd54i sender 92cd54i timing to writing to the transmission buffer cts (1) (2) 13 14 15 16 1 2 3 14 15 16 1 2 3 sioclk txdclk txd bit 0 start bit send is suspended from (1) and (2).
tmp92cd54i 2009-12-26 92cd54i-132 tentative (9) transmit buffer the cpu writes transmit data to the transmit buffer (sc0buf). the transmit buffer shifts out the data, one bit at a time, in an lsb-first manner, with the transmit shift clock, txdsft, generated from the tran smit controller. once all bits have been shifted out, an inttx0 interrupt occurs indicating that the transmit buffer is empty. (10) parity controller setting the sc0cr bit in the serial channel control register to 1 enables transmission with a parity. a parity can, however, be added only in 7-bit uart or 8-bit uart mode. the sc0cr register bit specifies whether an even or odd parity is used. when transmitting data, the parity controll er automatically generates a parity from the data written to the transmit buffer, sc0buf. the parity is transmitted using sc0buf in 7-bit uart mode or sc0mod0 in 8-bit uart mode. ensure that the sc0cr and sc0cr bits are set before writing transmit data to the receive buffer. when receiving data, the parity controller automatically generates a parity from the data that has been shifted into receive bu ffer 1 and then moved to receive buffer 2 (sc0buf). the generated parity is comp ared with the parity contained in sc0buf in 7-bit uart mode or sc0cr in 8-bit uart mode. if they differ, a parity error occurs an d the sc0cr flag is set. (11) error flags three error flags are provided to improve reliability in received data. 1. overrun error an overrun error occurs if all bits of next data are received into receive buffer 1 with valid data still containe d in receive buffer 2 (sc0buf). recommended processing flow when an overrun error occurs: (receive interrupt routine) 1) read the receive buffer. 2) read the error flag. 3) if =1 then 4) write 0 to to disable reception. 5) wait until the current frame is completed. 6) read the receive buffer. 7) read the error flag. 8) write 1 to to enable reception. 9) request retransmission. 10) miscellaneous processing 2. parity error a parity error occurs if the parity generated from the data moved to receive buffer 2 (sc0buf) differs from the parity bit received through the rxd pin. 3. framing error the stop bit in the received data is sa mpled three times near the middle of the reception period. a framing error occurs if it proves to be 0 based on majority rule.
tmp92cd54i 2009-12-26 92cd54i-133 tentative (12) start and stop ti mings for each signal a. in uart mode reception table 3.9.5 start and stop timings mode 9-bit (note) 8-bit + parity (note) 8-bit, 7-bit + parity, 7-bit interrupt timing center of last bit (bit 8) center of last bit (parity bit) center of stop bit framing error timing center of stop bit center of stop bit center of stop bit parity error timing ? center of last bit (parity bit) center of last bit (parity bit) overrun error timing center of last bit (bit 8) center of last bit (parity bit) center of stop bit note: in 9-bit mode or 8-bit + parity mode, the ninth bit pulse and an interrupt occur simultaneously. to normally check for a framing error, therefore, it is necessary to wait for a single bit cycle to transmit a stop bit. transmission table 3.9.6 stop timings mode 9-bit 8-bit + parity 8- bit, 7-bit + parity, 7-bit interrupt timing just before stop bit is transmitted just before stop bit is transmitted just before stop bit is transmitted b. i/o interface table 3.9.7 interrupt timings sclk output mode immediately after rise of last sclk signal. (see figure 3.9 20.) transmission interrupt timing sclk input mode immediately after rise of last sclk signal rising mode, or immediately after fall in falling mode. (see figure 3.9 21.) sclk output mode timing used to transfer received dat a to receive buffer 2 (sc0buf) (i.e. immediately after last sclk). (see figure 3.9 22.) receiving interrupt timing sclk input mode timing used to transfer received dat a to receive buffer 2 (sc0buf) (i.e. immediately after last sclk). (see figure 3.9 23.)
tmp92cd54i 2009-12-26 92cd54i-134 tentative 3.9.3 sfr description 7 6 5 4 3 2 1 0 bit symbol tb8 ctse rxe wu sm1 sm0 sc1 sc0 read/write r/w after reset undefined 0 0 0 0 0 0 0 function transfer data bit 8 hand shake 0: cts disable 1: cts enable receive function 0: receive disable 1: receive enable wake up function 0: disable 1: enable serial transmission mode 00: i/o interface mode 01: 7-bit uart mode 10: 8-bit uart mode 11: 9-bit uart mode serial transmission clock (uart) 00: t0trg 01: baud rate generator 10: internal clock 1 11: external clcok (sclk0 input) serial transmission clock source (uart) 00 timer 0 match detect signal (t0trg) 01 baud rate generator 10 internal clock 1 11 external clock (sclk0 input) note: in i/o interface mode, select the clock using the serial control register (sc0cr). serial transmission mode 00 i/o interface mode 01 7-bit mode 10 8-bit mode 11 uart 9-bit mode wake-up function 9-bit uart other modes 0 interrupt generated when data is received 1 interrupt generated only when rb8 = 1 0 receive disabled 1 receive enabled receiving function 0 disabled (always transferable) 1 enabled handshake function (cts pin) enable transmission data bit 8 don?t care sc0mod0 (00c2h) figure 3.9.8 serial mode control register (channel 0, sc0mod0)
tmp92cd54i 2009-12-26 92cd54i-135 tentative 7 6 5 4 3 2 1 0 bit symbol tb8 ctse rxe wu sm1 sm0 sc1 sc0 read/write r/w after reset undefined 0 0 0 0 0 0 0 function transfer data bit 8 hand shake 0: cts disable 1: cts enable receive function 0: receive disable 1: receive enable wake up function 0: disable 1: enable serial transmission mode 00: i/o interface mode 01: 7-bit uart mode 10: 8-bit uart mode 11: 9-bit uart mode serial transmission clock (uart) 00: t0trg 01: baud rate generator 10: internal clock 1 11: external clcok (sclk1 input) serial transmission clock source (uart) 00 timer 0 match detect signal (t0trg) 01 baud rate generator 10 internal clock 1 11 external clock (sclk1 input) note: in i/o interface mode, select the clock using the serial control register (sc1cr). serial transmission mode 00 i/o interface mode 01 7-bit mode 10 8-bit mode 11 uart 9-bit mode wake-up function 9-bit uart other modes 0 interrupt generated when data is received 1 interrupt generated only when rb8 = 1 0 receive disabled 1 receive enabled receiving function 0 disabled (always transferable) 1 enabled transmission data bit 8 don?t care sc1mod0 (00cah) handshake function (cts pin) enable figure 3.9.9 serial mode control register (channel 1, sc1mod0)
tmp92cd54i 2009-12-26 92cd54i-136 tentative 7 6 5 4 3 2 1 0 bit symbol rb8 even pe oerr perr ferr sclks ioc read/write r r/w r(cleared to 0 when read) r/w after reset undefined 0 0 0 0 0 0 0 function received data bit 8 parity 0: odd 1: even parity addition 0: disable 1: enable overrun parity framing 0: sclk0 1: sclk0 0: baud rate generator 1: sclk0 pin input sc0cr (00c1h) i/o interface input clock selection framing error flag parity error flag overrun error flag 0 transmits and receivers data on rising edge of sclk0. 1 transmits and receivers data on falling edge sclk0. edge selection for sclk0 pin (input mode only) 0 disabled 1 enabled parity addition enable even parity addition/check 1: error 0 baud rate generator 1 sclk0 pin input cleared to 0 when read 0 odd parity 1even parity received data 8 note: reading any of the error flags causes all of them to be cleared. do not use a bit test instruction to test a single bit only. figure 3.9.10 serial control register (channel 0, sc0cr)
tmp92cd54i 2009-12-26 92cd54i-137 tentative 7 6 5 4 3 2 1 0 bit symbol rb8 even pe oerr perr ferr sclks ioc read/write r r/w r (cleared to 0 when read) r/w after reset undefined 0 0 0 0 0 0 0 function received data bit 8 parity 0: odd 1: even parity addition 0: disable 1: enable overrun parity framing 0: sclk1 1: sclk1 0: baud rate generator 1: sclk1 pin input sc1cr (00c9h) i/o interface input clock select framing error flag parity error flag overrun error flag 0 transmits and receives data on rising edge of sclk1. 1 transmits and receives data on falling edge of sclk1. edge selection for sclk1 pin (input mode only) 0disabled 1 enabled parity addition enable even parity addition/check 1: error 0 baud rate generator 1 sclk1 pin input cleared to 0 when read 0 odd parity 1even parity received data bit 8 note: reading any of the error flags causes all of them to be cleared. do not use a bit test instruction to test a single bit only. figure 3.9.11 serial control register (channel 1, sc1cr)
tmp92cd54i 2009-12-26 92cd54i-138 tentative 7 6 5 4 3 2 1 0 bit symbol ? br0adde br0ck1 br0ck0 br0s3 br0s2 br0s1 br0s0 read/write r/w after reset 0 0 0 0 0 0 0 0 function (note) always fixed to ?0? +(16? k)/16 division 0: disable 1: enable 00 : t0 01 : t2 10 : t8 11 : t32 7 6 5 4 3 2 1 0 bit symbol br0k3 br0k2 br0k1 br0k0 read/write r/w after reset 0 0 0 0 function set frequency divisor k (divided by n + (16 ? k)/16) baud rate generator frequency divisor setting br0cr = 1 (uart only) br0cr = 0 (uart and i/o interface modes) br0cr br0add 0000(n = 16) or 0001(n = 1) 0010(n = 2) to 1111(n = 15) 0001(n = 1) (uart only) to 1111(n = 15) 0000(n = 16) 0000 disable * disable * 0001(k = 1) to 1111(k = 15) disable * divided by n + (16 ? k) / 16 divided by n *: when n = 1 or 16, division by n + (16 - k)/16 in uart mode cannot be used. division by n + (16 - k)/16 with =0000 is also not supported. if any of those settings are used, set br0cr to 0 to disable division by n + (16 - k)/16. note 1: when using division by n + (16 - k)/16, first set the value of k (k = 1 to 15) in br0add before se tting br0cr to 1. note 2: division by n + (16 - k)/16 can only be used in uart mode. in i/o interface mode, set br0cr to 0 to disable division by n + (16 - k)/16. figure 3.9.12 baud rate generator control (channel 0, br0cr, br0add) +(16 - k) / 16 division enable 00 internal clock t0 01 internal clock t2 10 internal clock t8 11 internal clock t32 in p ut clock selection for baud rate g enerato r 0 disabled 1 enabled setting of the divided frequency br0cr (00c3h) br0add (00c4h)
tmp92cd54i 2009-12-26 92cd54i-139 tentative 7 6 5 4 3 2 1 0 bit symbol - br1adde br1ck1 br1ck0 br1s3 br1s2 br1s1 br1s0 read/write r/w after reset 0 0 0 0 0 0 0 0 function (note) always fixed to ?0? +(16? k)/16 division 0: disable 1: enable 00 : t0 01 : t2 10 : t8 11 : t32 7 6 5 4 3 2 1 0 bit symbol - - - - br1k3 br1k2 br1k1 br1k0 read/write r/w after reset - - - - 0 0 0 0 function set frequency divisor k (divided by n + (16 ? k)/16) baud rate generator frequency divisor setting br1cr = 1 (uart only) br1cr = 0 (uart and i/o interface modes) br1cr br1add 0000(n = 16) or 0001(n = 1) 0010(n = 2) to 1111(n = 15) 0001(n = 1) (uart only) to 1111(n = 15) 0000(n = 16) 0000 disable * disable * 0001(k = 1) to 1111(k = 15) disable * divided by n + (16 ? k) / 16 divided by n *: when n = 1 or 16, division by n + (16 - k)/16 in uart mode cannot be used. division by n + (16 - k)/16 with =0000 is also not supported. if any of those settings are used, set br0cr to 0 to disable division by n + (16 - k)/16. note 1: when using division by n + (16 - k)/16, first set the value of k (k = 1 to 15) in br1add before se tting br1cr to 1. note 2: division by n + (16 - k)/16 can only be used in uart mode. in i/o interface mode, set br1cr to 0 to disable division by n + (16 - k)/16. figure 3.9.13 baud rate generator control (channel 1, br1cr, br1add) br1cr (00cbh) +(16 - k) / 16 division enable 00 internal clock t0 01 internal clock t2 10 internal clock t8 11 internal clock t32 input clock selection for baud rate generator 0 disabled 1 enabled setting of the divided frequency br1add (00cch)
tmp92cd54i 2009-12-26 92cd54i-140 tentative tb7 7 7 6 6 5 5 4 4 3 3 2 2 1 1 0 0 sc0buf (00c0h) (transmission) (reveiving) tb6 tb5 tb4 tb3 tb2 tb1 tb0 rb7 rb6 rb5 rb4 rb3 rb2 rb1 rb0 note: sc0buf does not support a read-modify-write operation. figure 3.9.14 serial transmission/receiv ing buffer registers (channel 0, sc0buf) 7 6 5 4 3 2 1 0 bit symbol i2s0 fdpx0 - - - - - - read/write r/w r/w after reset 0 0 - - - - - - function idle2 0: stop 1: run duplex 0: half 1: full figure 3.9.15 serial mode control register 1 (channel 0, sc0mod1) tb7 7 7 6 6 5 5 4 4 3 3 2 2 1 1 0 0 sc1buf (00c8h) (transmission) (receiving) tb6 tb5 tb4 tb3 tb2 tb1 tb0 rb7 rb6 rb5 rb4 rb3 rb2 rb1 rb0 note: sc1buf does not support a read-modify-write operation. figure 3.9.16 serial transmission/receiv ing buffer registers (channel 1, sc1buf) 7 6 5 4 3 2 1 0 bit symbol i2s1 fdpx1 - - - - - - read/write r/w r/w after reset 0 0 - - - - - - function idle2 0: stop 1: run duplex 0: half 1: full figure 3.9.17 serial mode control register 1 (channel 1, sc1mod1) sc0mod1 (00c5h) sc1mod1 (00cdh)
tmp92cd54i 2009-12-26 92cd54i-141 tentative 3.9.4 operation in each mode (1) mode 0 (i/o interface mode) this mode is used to increase the number of input/output pins (i/o). in this mode, a serial channel transmits and re ceives data to and from a shift register or other devices connected externally. the i/o interface mode can be selected between sclk output mode, in which the tmp92cd54i outputs a synchronization clock (sclk) and sclk input mode, in which sclk is supplied from an external device. output extension tmp92cd54i txd scl k port input extension tc74hc595 or equivalent tc74hc165 or equivalent tmp92cd54i a b c d e f g h rxd sclk port shift register a b c d e f g h si sck rck qh clock shift register s/l figure 3.9.18 example of sclk output mode connection tmp92cd54i txd scl k port tmp92cd54i a b c d e f g h rxd sclk port shift register a b c d e f g h si sck rck qh clock external clock output extension input extension tc74hc595 or equivalent tc74hc165 or equivalent external clock shift register s/l figure 3.9.19 example of sclk input mode connection
tmp92cd54i 2009-12-26 92cd54i-142 tentative a. transmission in sclk output mode, every time the cpu writes data to the transmit buffer, 8-bit data is output through the txd0 pin and the synchronization clock through the sclk0 pin. once all data has been output, intes0 is set to 1 and an inttx0 interrupt occurs. figure 3.9.20 transmitting operation in i/o interface mode (sclk0 output mode) in sclk input mode, when the transmit buffer contains data written by the cpu, activating the sclk0 input causes 8-bit data to be output through the txd0 pin. once all data has been output, intes0 is set to 1 and an inttx0 interrupt occurs. figure 3.9.21 transmitting operation in i/o interface mode (sclk0 input mode) timing to write transmisison data sclk0 output bit 0 bit 6 bit 7 bit 1 txd0 itx0c (inttx0 interrupt request) sclk0 input (=0: rising edge mode) sclk0 input (=1: falling edge mode) bit 0 bit 1 txd0 itx0c (inttx0 interrupt request) bit 5 bit 6 bit 7
tmp92cd54i 2009-12-26 92cd54i-143 tentative b. reception in sclk output mode, every time the cp u reads received data and the receive interrupt flag, intes0, is cleare d, the synchronization clock is output through the sclk0 pin and next data is shifte d into receive buffer 1. once 8-bit data has been received, the data is moved to receive buffer 2 (sc0buf), causing intes0 to be re-set to 1 an d an intrx0 interrupt to occur. the initial start of sclk output is triggered by setting sc0mod0 to 1. figure 3.9.22 receiving operation in i/o interface mode (sclk0 output mode) in sclk input mode, when the cpu has read received data and the receive interrupt flag, intes0, has been cl eared, activating the sclk0 input causes next data to be shifted into receive buffer 1. once 8-bit data has been received, the data is moved to receive buffer 2 (sc0buf), causing intes0 to be re-set to 1 and an intrx0 interrupt to occur. figure 3.9.23 receiving operation in i/o interface mode (sclk0 input mode) note: to receive data, in either sclk input or output mode, ensure that sc0mod0 is set to 1 to enable reception. sclk0 output irx0c(intrx0 interrupt request) rxd0 bit 0 bit 6 bit 7 bit 1 sclk0 input ( = 0: rising edge mode) bit 0 bit 6 bit 7 irx0c (intrx0 interrupt request) bit 1 rxd0 bit 5 sclk0 input ( = 1: falling edge mdoe)
tmp92cd54i 2009-12-26 92cd54i-144 tentative c. transmission/reception (full duplex) to transmit and receive data in full duplex mode, set the receive interrupt level to 0 and the transmit interrupt level to any of 1 to 6. perform receive processing in the transmit interrupt handling routine, as shown below, before setting next data to be transmitted: example: channel 0, sclk output transmit and receive data at 9600 bps fc = 19.6608 mhz main routine 7 6 5 43210 intes0 x 0 0 1 x000 set transmit interrupt level to 1 and set receive interrupt level to 0 (disable). pfcr ? ? ? ? ?101 set pf0, pf1 and pf2 to the txd0, rxd0 and pffc ? ? ? ? ?1?1 sclk0 pins, respectively. sc0mod0 0 0 0 0 0000 enable reception and set i/o interface mode. sc0mod1 1 1 0 0 0000 specify full duplex mode. sc0cr 0 0 0 0 0000 sclk_out, transmit on falling edge and receive on rising edge. br0cr 0 0 1 0 0000 select 9600 bps. sc0mod0 0 0 1 0 0000 enable reception. sc0buf * * * * **** set transmit data and activate. inttx0 interrupt routine acc sc0buf read the received data. sc0buf * * * * **** set transmit data. x = don't care "-" = no change
tmp92cd54i 2009-12-26 92cd54i-145 tentative (2) mode 1 (7-bit uart mode) setting sc0mod0 to 01 in the seri al channel mode regi ster selects 7-bit uart mode. in this mode, a parity bit can be added and sc0cr in the serial channel control register enables or disables the addition of a parity bit. when = 1 (enabled), either an even or odd parity can be selected using sc0cr. example: the table below shows control regi ster settings for tran smitting data in the following format: 7 6 5 4 3 2 1 0 pfcr ? ? ? ? ? ? ? 1 pffc ? ? ? ? ? ? ? 1 set pf0 to function as the txd0 pin. sc0mod0 x 0 ? x 0 1 0 1 select 7-bit uart mode. sc0cr x 1 1 x x x 0 0 select even parity mode. br0cr 0 0 1 0 1 0 0 0 set transfer rate to 2400 bps. intes0 x 1 0 0 ? ? ? ? enable inttx0 interrupt and set the level to 4. sc0buf * * * * * * * * set transmit data. x = don?t care; ? ? ? = no change figure 3.9.24 transmit data example (mode 1) (3) mode 2 (8-bit uart mode) setting sc0mod0 to 10 selects 8-bit uart mode. in this mode, a parity bit can be adde d and sc0cr enables or disables the addition of a parity bit. when = 1 (enabled), either an even or odd parity can be selected using sc0cr. example: the table below shows control regi ster settings for receiving data in the following format: direction of transfer (transfer rate: 2400 bps when fc = 19.6608 mhz) start bit 0 1 2 3 5 4 6 even parity stop direction of transfer (transfer rate: 9600 bps when fc = 19.6608 mhz) start bit 0 1 2 3 5 4 6 odd parity stop 7
tmp92cd54i 2009-12-26 92cd54i-146 tentative settings in main routine 7 6 5 4 3 2 1 0 pfcr ? ? ? ? ? ? 0 ? set pf1 to the rxd0 pin. sc0mod0 ? 0 1 x 1 0 0 1 enable reception and select 8-bit uart mode. sc0cr x 0 1 x x x 0 0 select odd parity mode. br0cr 0 0 0 1 1 0 0 0 set transfer rate to 9600 bps. intes0 ? ? ? ? x 100 enable intrx0 interrupt and set the level to 4. settings in interrupt routine acc sc0cr and 00011100 if acc 0 then error check for errors. acc sc0buf read the received data. x = don't care "-" = no change figure 3.9.25 transmit data example (mode 2) (4) mode 3 (9-bit uart mode) setting sc0mod0 to 11 selects 9-bit uart mode. this mode does not support a parity bit. the most significant bit (bit 9) is written to sc0mod0 in the serial channel mode register for transmission or stored into sc0cr in the serial channel control register for reception. when data is written to or read from the buffer, the most significant bit must always be transferred first, followed by the bits in sc0buf. wakeup function in 9-bit uart mode, setting sc0mod to 1 enables slave controller wakeup operation and an intrx0 interrupt occurs only if = 1. txd master slave 1 slave 2 slave 3 rxd txd rxd txd txd rxd rxd note: the txd pin on the slave controller must be set to open-drain. figure 3.9.26 serial link using wakeup function
tmp92cd54i 2009-12-26 92cd54i-147 tentative protocol a. set the master and slave controllers to 9-bit uart mode. b. in each slave controller, set sc 0mod0 to 1 to enable reception. c. the master controller transmits a single frame including the slave controller selection code (8 bits). the most significant bit (bit 8) of the frame, , must be set to 1. select code of slave controller start bit 0 1 2 3 5 46 s t o p 78 ?1? figure 3.9.27 frame (1) d. each slave controller receives the above frame. the slave controller whose code matches the received selection code clears the wu bit to 0. e. the master controller transmits data to the selected slave controller (with sc0mod0 cleared to 0). the most signif icant bit (bit 8) of the data, , must be set to 0. data ?0? start bit 0 1 2 3 5 46 s t o p 7bit 8 figure 3.9.28 frame (2) f. the other slave controllers, with set to 1, ignore the received data because the most significant bit (bit 8) of is 0 so that an intrx0 interrupt does not occur. the slave controller with cleared to 0 can also transmit data to the master controller to notify that it has completed receiving the data.
tmp92cd54i 2009-12-26 92cd54i-148 tentative example: serially linking with two slave controllers using internal clock 1 as the transfer clock txd master slave 1 slave 2 select code 00000001 rxd txd rxd txd rxd select code 00001010 figure 3.9.29 transfer clock example ? settings in master controller main routine pfcr ? ? ? ? ? ? 01 pffc ? ? ? ? ? ? -1 set pf0 and pf1 to the txd0 and rxd0 pins, respectively. intes0 x 1 0 0 x 1 0 1 enable inttx0 interrupt and set the level to 4. enable intrx0 interrupt and set the level to 5. sc0mod0 1 0 1 0 1 1 1 0 select 9-bit uart mode and set transfer rate to 1. sc0buf 0 0 0 0 0 0 0 1 set the selection code for slave 1. inttx0 interrupt routine sc0mod0 0 ? ? ? ? ? ? ? set tb8 to 0. sc0buf * * * * * * * * set transmit data. ? settings in slave controller main routine pfcr ? ? ? ? ? ? 00 set pf1 and pf0 to rxd0 and txd0 (open-drain output), pffc - - - - - - - 1 respectively. intes0 x 1 0 1 x 1 1 0 enable intrx0 and inttx0. sc0mod0 0 0 1 1 1 1 1 0 select 9-bit uart mode, set transfer rate to 1 and wu to 1. intrx0 interrupt routine acc sc0buf if acc = select code then sc0mod0 - - - 0 - - - - clear to 0.
tmp92cd54i 2009-12-26 92cd54i-149 tentative 3.10 serial bus interface (sbi) the tmp92cd54i contains three serial bus interface (sbi) channels, sbi0, sbi1, and sbi2. the serial bus interface supports the following two operating modes: ? i 2 c bus mode (multi-master) ? clock synchronous 8-bit sio mode table 3.10.1 used pins i 2 c bus clocked-synchronous 8-bit sio sbi0 scl0 (pn2), sda0 (pn1) pnode sck0 (pn0), so0 (pn1), si0 (pn2) sbi1 scl1 (pn5), sda1 (pn4) pnode sck1 (pn3), so1 (pn4), si1 (pn5) sbi2 scl2 (p72), sda2 (pn6) pnode sck2 (pm4), so2 (pn6), si2 (p72) each channel operates in the same way. this section describes only sbi0. in i 2 c bus mode, the tmp92cd54i is connected to an external device through pn1 (sda0) and pn2 (scl0). in clock synchronous 8-bit sio mode, the tmp92cd54i is connected to an external device through pn0 (sck0), pn1 (so0), and pn2 (si0). the following table shows the pin settings for each mode: table 3.10.2 pin settings pnode pncr pnfc i 2 c bus mode 11 11x 11x clocked synchronous 8-bit sio mode xx 011 010 011 x: don?t care
tmp92cd54i 2009-12-26 92cd54i-150 tentative 3.10.1 configuration i 2 c bus clock sync. + control noise canceller shift register sbi0cr2/ sbi0sr sbi0dbr intsbs0 interrupt request (stop condition) t sbi0 control register 2/ sbi0 status register i 2 c bus 0 address register sbi0 data buffer register sbi0 control register 1 sbi0 baud rate ragister 0, 1 sda0 so0 si0 scl0 sck0 pn0 pn1 pn2 (sck0) (so0/sda0) (si0/scl0) sio clock control divider sbi0cr1 sbi0br0, 1 nosie canceller i 2 c bus data control sio data control input/ output control intsbe0 interrupt request (address / data) i2c0ar transfer control circuit figure 3.10.1 serial bus interface 0 (sbi0)
tmp92cd54i 2009-12-26 92cd54i-151 tentative 3.10.2 control the following registers are used to contro l the serial bus interface and monitor its operating state: ? serial bus interface 0 control register 1 (sbi0cr1) ? serial bus interface 0 control register 2 (sbi0cr2) ? serial bus interface 0 data buffer register (sbi0dbr) ? i 2 c bus 0 address register (i2c0ar) ? serial bus interface 0 status register (sbi0sr) ? serial bus interface 0 baud rate register 0 (sbi0br0) ? serial bus interface 0 baud rate register 1 (sbi0br1) the above registers have different functions depending on the mode in which they are used. for details, see "3.10.4 control registers in i 2 c bus mode" and "3.10.7 control in clock synchronous 8-bit sio mode." 3.10.3 data formats in i 2 c bus mode figure 3.10.2 shows the data formats used in i 2 c bus mode. s (a) addressing format (b) addressing format (with restart) (c) free data format (transfer format for transferring data from the master device to a slave device) slave address data a c k p s s sp p 8 bits 1 to 8 bits 1 1 1 or more 1 to 8 bits a c k a c k slave address data data 1 1 a c k a c k a c k a c k 8 bits 1 to 8 bits 8 bits 1 to 8 bits 11 1 1 1 1 8 bits 1 to 8 bits 1 to 8 bits data data data data a c k a c k a c k 1 1 1 slave address 1 or more 1 1 or more 1 or more r / w r / w r / w note: s: start condition : direction bit ack: acknowledge bit p: stop condition r / w figure 3.10.2 data format in the i 2 c bus mode
tmp92cd54i 2009-12-26 92cd54i-152 tentative 3.10.4 control registers in i 2 c bus mode the following registers are used to control the serial bus interface (sbi) and monitor its operating state in i 2 c bus mode: serial bus interface 0 control register 1 7 6 5 4 3 2 1 0 bit symbol bc2 bc1 bc0 ack sck3 sck2 sck1 swrmon/ sck0 read/write w r/w w r/w after reset 0 0 0 0 1 0 0 1/0(note3) function number of transferred bits (note 1) acknowledge mode specification 0: not generate 1: generate internal serial clock selection and software reset monitor (note 2) internal serial clock selection @ write 0001 0010 0011 0100 0101 0110 1000 1111 other n = 6 n = 7 n = 8 n = 9 n = 10 n = 11 fast standard - ? ? 75.8 khz 38.5 khz 19.4 khz 9.73 khz 400 khz 100 khz (reserved) cpu clock: fc = 20 mhz internal scl output ( fscl = [ hz ] ) ( fscl = fc/50 [ hz ] ) ( fscl = fc/200 [ hz ] ) software reset state monitor @ read 0 during software reset 1 initial data acknowledge mode specification 0 not generate clock pulse for acknowledge signal 1 generate clock pulse for acknowledge signal number of bits transferred = 0 = 1 number of clock pulses bits number of clock pulses bits 000 001 010 011 100 101 110 111 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 9 2 3 4 5 6 7 8 8 1 2 3 4 5 6 7 sbi0cr1 (0170h) note 1: it is necessary to clear to 000 before attempting to change the operating mode to clock synchronous 8-bit sio mode. note 2: for details of the scl line clock frequency, see "3.10.5 (3) serial clock." note 3: the initial values of sck0 and swrmon are 0 and 1, res p ectivel y . fc 2 n + 8 read- modify- write not allowed figure 3.10.3 registers for the i 2 c bus mode
tmp92cd54i 2009-12-26 92cd54i-153 tentative serial bus interface 0 control register 2 7 6 5 4 3 2 1 0 bit symbol mst trx bb pin sbim1 sbim0 swrst1 swrst0 read/write w w (note 1) w (note 1) after reset 0 0 0 1 0 0 0 0 function master/slave selection transmitter/ receiver selection start/stop generation cancel intsbe0 interrupt request serial bus interface operating mode selection (note 2) 00: port mode 01: sio mode 10: i 2 c bus mode 11: (reserved) software reset generate write ?10? and ?01?, then an internal reset signal is generated. serial bus interface operating mode selection (note 2) 00 port mode (serial bus interface output disabled) 01 clocked synchronous 8-bit sio mode 10 i 2 c bus mode 11 (reserved) intsbe0 interrupt request 0 ? 1 cancel interrupt request start / stop generation 0 generates the stop condition 1 generates the start condition transmitter / receiver selection 0 receiver 1 transmitter master / slave selection 0slave 1master sbi0cr2 (0173h) note1: when read, this register functions as sbi0sr. note2: ensure that the bus is free before attempting to select port mode. also ensure that the port state is high before attempting to change the mode from port mode to i 2 c bus or clock synchronous 8-bit sio mode. read- modify- write not allowed figure 3.10.4 registers for the i 2 c bus mode
tmp92cd54i 2009-12-26 92cd54i-154 tentative serial bus interface 0 status register 7 6 5 4 3 2 1 0 bit symbol mst trx bb pin al aas ad0 lrb read/write r after reset 0 0 0 1 0 0 0 0 function master/ slave status monitor transmitter/ receiver status monitor i 2 c bus status monitor intsbe0 interrupt request monitor arbitration lost detection monitor 0: ? 1: detected slave address match detection monitor 0: undetected 1: detected general call detection monitor 0: undetected 1: detected last received bit monitor 0: ?0? 1: ?1? last received bit monitor 0 last received bit was ?0? 1 last received bit was ?1? general call detection monitor 0 undetected 1 general call detected slave address match detection monitor 0 undetected 1 slave address match or general call detected arbitration lost detection monitor 0 ? 1 arbitration lost intsbe0 interrupt request monitor 0 interrupt requested 1 interrupt canceled i 2 c bus status monitor 0 free (note2) 1busy transmitter / receiver status monitor 0 receiver 1 transmitter master / slave status monitor 0slave 1master sbi0sr (0173h) read- modify- write not allowed note1: when written, this register functions as sbi0cr2. note2: when the bb flag changes its state from 1 to 0 (falling edge), intsbs0 occurs. figure 3.10.5 registers for the i 2 c bus mode
tmp92cd54i 2009-12-26 92cd54i-155 tentative serial bus interface 0 baud rate register 0 7 6 5 4 3 2 1 0 bit symbol - i2sbi0 - - - - - - read/w rite w r/w after reset 0 0 - - - - - - function (note) fixed to ?0? idle2 0: stop 1: run operation during idle 2 mode 0 stop 1operate serial bus interface 0 baud rate register 1 7 6 5 4 3 2 1 0 bit symbol p4mon/ p4en - - - - - - - read/w rite r/w after reset 0 - - - - - - - function internal clock 0: stop 1: operate baud rate clock control 0 stop 1operate serial bus interface 0 data buffer register 7 6 5 4 3 2 1 0 bit symbol rb7/tb7 rb6/tb6 rb5/tb5 rb4/tb4 rb3/tb3 rb2/tb2 rb1/tb1 rb0/tb0 read/w rite r (received)/w (transfer) after reset undefined note: w hen writing transmit data, justify the data toward the msb (bit 7) side. i 2 c bus 0 address register 7 6 5 4 3 2 1 0 bit symbol sa6 sa5 sa4 sa3 sa2 sa1 sa0 als read/w rite w after reset 0 0 0 0 0 0 0 0 function slave address selection for when device is operating as slave device addressing or free dat a format address recognition mode specification 0 addressing format 1 free data format sbi0br0 (0174h) sbi0dbr (0171h) i2c0ar (0172h) read- modify- write not allowed sbi0br1 (0175h) read- modify- write not allowed read- modify- write not allowed the addressing or free data format affects both the slave and master. when using the addressing format (=0), the trx bit is updated with the direction bit, r/w (bit 8 of the first byte received after the start condition) . in addition, in slave mode, the mcu finds the bus when it recognizes the address which follows the start condition. when using the free data format (=1), trx remains unchanged because all words on the bus are not recognized as an address but as data words. figure 3.10.6 registers for the i 2 c bus mode
tmp92cd54i 2009-12-26 92cd54i-156 tentative seir ial bus interface 1 c onrol register 1 7 6 5 4 3 2 1 0 bit symbol bc2 bc1 bc0 ack sck3 sck2 sck1 sw rmon/ sc k0 read/w rite w r/w w r/w after r eset 0 0 0 0 1 0 0 1/0(n ote3) function number of transferred bits (not e 1) acknowledge mode specification 0: n ot generate 1: generate internal serial c lock s election and software reset monitor (note 2) i nternal serial clock selection @ write 0001 0010 0011 0100 0101 0110 1000 1111 other n = 6 n = 7 n = 8 n = 9 n = 10 n = 11 fast standard - ? ? 75 .8 khz 38 .5 khz 19 .4 khz 9.73 khz 400 khz 100 khz (reserved) cpu clock: fc = 20 mhz internal scl output (fscl = [ h z ] ) (fscl = fc/50 [ hz ] ) (fscl = fc/200 [ hz ] ) software reset state monitor @ read 0 during software reset 1 initial data a ckno wled ge m ode sp ecific ation 0 n ot generate clock pulse for acknowledge signal 1 generat e clock pulse for acknowledge signal n umber of bits tr ansferred = 0 = 1 number of clock pulses bits number of clock pulses bits 000 001 010 011 100 101 110 111 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 9 2 3 4 5 6 7 8 8 1 2 3 4 5 6 7 sbi1cr1 (0178h) note 1: it is necessary to clear to 000 before attempting to change the operating mode to cloc k synchronous 8-bit sio mode. note 2: for details of the scl line clock frequency, see "3.10.5 (3) serial clock." note 3: the initial values of sck1 and swrmon are 0 and 1, respectively. fc 2 n + 8 r ead- modify- write not allowed figure 3.10.7 registers for the i 2 c bus mode
tmp92cd54i 2009-12-26 92cd54i-157 tentative serial bus interface 1 control register 2 7 6 5 4 3 2 1 0 bit symbol mst trx bb pin sbim1 sbim0 swrst1 swrst0 read/write w w (note 1) w (note 1) after reset 0 0 0 1 0 0 0 0 function master/slave selection transmitter/ receiver selection start/stop generation cancel intsbe1 interrupt request serial bus interface operating mode selection (note 2) 00: port mode 01: sio mode 10: i 2 c bus mode 11: (reserved) software reset generate write ?10? and ?01?, then an internal reset signal is generated. serial bus interface operating mode selection (note 2) 00 port mode (serial bus interface output disabled) 01 clocked synchronous 8-bit sio mode 10 i 2 c bus mode 11 (reserved) intsbe1 interrupt request 0 ? 1 cancel interrupt request start / stop generation 0 generates the stop condition 1 generates the start condition transmitter / receiver selection 0 receiver 1 transmitter master / slave selection 0slave 1master sbi1cr2 (017bh) note1: when read, this register functions as sbi1sr. note2: ensure that the bus is free before attempting to select port mode. also ensure that the port state is high before attempting to change the mode from port mode to i 2 c bus or clock synchronous 8-bit sio mode. read- modify- write not allowed figure 3.10.8 registers for the i 2 c bus mode
tmp92cd54i 2009-12-26 92cd54i-158 tentative serial bus interface 1 status register 7 6 5 4 3 2 1 0 bit symbol mst trx bb pin al aas ad0 lrb read/write r after reset 0 0 0 1 0 0 0 0 function master/ slave status monitor transmitter/ receiver status monitor i 2 c bus status monitor intsbe1 interrupt request monitor arbitration lost detection monitor 0: ? 1: detected slave address match detection monitor 0: undetected 1: detected general call detection monitor 0: undetected 1: detected last received bit monitor 0: ?0? 1: ?1? last received bit monitor 0 last received bit was ?0? 1 last received bit was ?1? general call detection monitor 0 undetected 1 general call detected slave address match detection monitor 0 undetected 1 slave address match or general call detected arbitration lost detection monitor 0 ? 1 arbitration lost intsbe1 interrupt request monitor 0 interrupt requested 1 interrupt canceled i 2 c bus status monitor 0 free (note2) 1busy transmitter / receiver status monitor 0 receiver 1 transmitter master / slave status monitor 0slave 1master sbi1sr (017bh) note1: when written, this register functions as sbi1cr2. note2: when the bb flag changes its state from 1 to 0 (falling edge), intsbs1 occurs. read- modify- write not allowed figure 3.10.9 registers for the i 2 c bus mode
tmp92cd54i 2009-12-26 92cd54i-159 tentative serial bus interface 1 baud rate register 0 7 6 5 4 3 2 1 0 bit symbol - i2sbi0 - - - - - - read/write w r/w after reset 0 0 - - - - - - function (note) fixed to ?0? idle2 0: stop 1: run operation during idle 2 mode 0 stop 1 operate serial bus interface 1 baud rate register 1 7 6 5 4 3 2 1 0 bit symbol p4mon/ p4en - - - - - - - read/write r/w after reset 0 - - - - - - - function internal clock 0: stop 1: operate baud rate clock control 0 stop 1 operate serial bus interface 1 data buffer register 7 6 5 4 3 2 1 0 bit symbol rb7/tb7 rb6/tb6 rb5/tb5 rb4/tb4 rb3/tb3 rb2/tb2 rb1/tb1 rb0/tb0 read/write r (received)/w (transfer) after reset undefined note: when writing transmit data, justify the data toward the msb (bit 7) side. i 2 c bus 1 address register 7 6 5 4 3 2 1 0 bit symbol sa6 sa5 sa4 sa3 sa2 sa1 sa0 als read/write w after reset 0 0 0 0 0 0 0 0 function slave address selection for when device is operating as slave device addressing or free dat a format address recognition mode specification 0 addressing format 1 free data format sbi1br0 (017ch) sbi1dbr (0179h) i2c1ar (017ah) sbi1br1 (017dh) read- modify- write not allowed read- modify- write not allowed read- modify- write not allowed read- modify- write not allowed the addressing or free data format affects both the slave and master. when using the addressing format (=0), the trx bit is updated with the direction bit, r/w (bit 8 of the first byte received after the start condition). in addition, in slave mode, the mcu finds the bus after the start condition with which it recognizes the address. when using the free data format (=1), trx remains unchanged because all words on the bus are not recognized as an address but as data words. figure 3.10.10 registers for the i 2 c bus mode
tmp92cd54i 2009-12-26 92cd54i-160 tentative serial bus interface 2 control r egister 1 7 6 5 4 3 2 1 0 bit symbol bc2 bc1 bc0 ack sck3 sck2 sck1 sw rmon/ sc k0 read/w rite w r/w w r/w after r eset 0 0 0 0 1 0 0 1/0(n ote3) function number of transferred bits (not e 1) acknowledge mode specification 0: n ot generate 1: generate internal serial c lock s election and software reset monitor (note 2) i nternal serial clock selection @ write 0001 0010 0011 0100 0101 0110 1000 1111 other n = 6 n = 7 n = 8 n = 9 n = 10 n = 11 fast standard - ? ? 75 .8 khz 38 .5 khz 19 .4 khz 9.73 khz 400 khz 100 khz (reserved) cpu clock: fc = 20 mhz internal scl output (fscl = [ h z ] ) (fscl = fc/50 [ hz ] ) (fscl = fc/200 [ hz ] ) software reset state monitor @ read 0 during software reset 1 initial data a ckno wled ge m ode sp ecific ation 0 n ot generate clock pulse for acknowledge signal 1 generat e clock pulse for acknowledge signal n umber of bits tr ansferred = 0 = 1 number of clock pulses bits number of clock pulses bits 000 001 010 011 100 101 110 111 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 9 2 3 4 5 6 7 8 8 1 2 3 4 5 6 7 sbi2cr1 (0180h) note 1: it is necessary to clear to 000 before attempting to change the operating mode to cloc k synchronous 8-bit sio mode. note 2: for details of the s cl l ine cl ock frequency, see "3.10.5 (3) seri al cl ock ." note 3: the initial values of sck2 and swrmon are 0 and 1, respectively. fc 2 n + 8 r ead- modify- write not allowed figure 3.10.11 registers for the i 2 c bus mode
tmp92cd54i 2009-12-26 92cd54i-161 tentative serial bus interface 2 control register 2 7 6 5 4 3 2 1 0 bit symbol mst trx bb pin sbim1 sbim0 swrst1 swrst0 read/write w w (note 1) w (note 1) after reset 0 0 0 1 0 0 0 0 function master/slave selection transmitter/ receiver selection start/stop generation cancel intsbe1 interrupt request serial bus interface operating mode selection (note 2) 00: port mode 01: sio mode 10: i 2 c bus mode 11: (reserved) software reset generate write ?10? and ?01?, then an internal reset signal is generated. serial bus interface operating mode selection (note 2) 00 port mode (serial bus interface output disabled) 01 clocked synchronous 8-bit sio mode 10 i 2 c bus mode 11 (reserved) intsbe1 interrupt request 0 ? 1 cancel interrupt request start / stop generation 0 generates the stop condition 1 generates the start condition transmitter / receiver selection 0 receiver 1 transmitter master / slave selection 0slave 1master read- modify- write not allowed sbi2cr2 (0183h) note1: when read, this register functions as sbi2sr. note2: ensure that the bus is free before attempting to select port mode. also ensure that the port state is high before attempting to change the mode from port mode to i 2 c bus or clock synchronous 8-bit sio mode. figure 3.10.12 registers for the i 2 c bus mode
tmp92cd54i 2009-12-26 92cd54i-162 tentative serial bus interface 2 status register 7 6 5 4 3 2 1 0 bit symbol mst trx bb pin al aas ad0 lrb read/write r after reset 0 0 0 1 0 0 0 0 function master/ slave status monitor transmitter/ receiver status monitor i 2 c bus status monitor intsbe1 interrupt request monitor arbitration lost detection monitor 0: ? 1: detected slave address match detection monitor 0: undetected 1: detected general call detection monitor 0: undetected 1: detected last received bit monitor 0: ?0? 1: ?1? last received bit monitor 0 last received bit was ?0? 1 last received bit was ?1? general call detection monitor 0 undetected 1 general call detected slave address match detection monitor 0 undetected 1 slave address match or general call detected arbitration lost detection monitor 0 ? 1 arbitration lost intsbe1 interrupt request monitor 0 interrupt requested 1 interrupt canceled i 2 c bus status monitor 0 free (note2) 1busy transmitter / receiver status monitor 0 receiver 1 transmitter master / slave status monitor 0slave 1master sbi2sr (017bh) note1: when written, this register functions as sbi2cr2. note2: when the bb flag changes its state from 1 to 0 (falling edge), intsbs2 occurs. read- modify- write not allowed figure 3.10.13 registers for the i 2 c bus mode
tmp92cd54i 2009-12-26 92cd54i-163 tentative serial bus interface 2 baud rate regster 0 7 6 5 4 3 2 1 0 bit symbol - i2sbi0 - - - - - - read/write w r/w after reset 0 0 - - - - - - function (note) fixed to ?0? idle2 0: stop 1: run operation during idle 2 mode 0 stop 1 operate serial bus interface 2 baud rate register 1 7 6 5 4 3 2 1 0 bit symbol p4mon/ p4en - - - - - - - read/write r/w after reset 0 - - - - - - - function internal clock 0: stop 1: operate baud rate clock control 0 stop 1 operate sirial bus interface 2 data buffer register 7 6 5 4 3 2 1 0 bit symbol rb7/tb7 rb6/tb6 rb5/tb5 rb4/tb4 rb3/tb3 rb2/tb2 rb1/tb1 rb0/tb0 read/write r (received)/w (transfer) after reset undefined note: when writing transmit data, justify the data toward the msb (bit 7) side. i 2 c bus 2 address register 7 6 5 4 3 2 1 0 bit symbol sa6 sa5 sa4 sa3 sa2 sa1 sa0 als read/write w after reset 0 0 0 0 0 0 0 0 function slave address selection for when device is operating as slave device addressing or free dat a format address recognition mode specification 0 addressing format 1 free data format sbi2br0 (0184h) sbi2dbr (0181h) i2c2ar (0182h) sbi2br1 (0185h) read- modify- write not allowed read- modify- write not allowed read- modify- write not allowed read- modify- write not allowed the addressing or free data format affects both the slave and master. when using the addressing format (=0), the trx bit is updated with the direction bit, r/w (bit 8 of the first byte received after the start condition). in addition, in slave mode, the mcu finds the bus after the start condition with which it recognizes the address. when using the free data format (=1), trx remains unchanged because all words on the bus are not recognized as an address but as data words. figure 3.10.14 registers for the i 2 c bus mode
tmp92cd54i 2009-12-26 92cd54i-164 tentative 3.10.5 control in i 2 c bus mode (1) specifying acknowledgment mode when sbi0cr1 is set to 1, the serial bus interface operates in acknowledgment mode. when operating as the master, it adds a single clock cycle for an acknowledge signal. when operating as a slave, it counts a clock cycle for an acknowledge signal. in transmitter mode, the serial bus interface relinquishes the sd a0 pin during that clock cycle so that it can receive an acknowledge signal from the receiver. in receive mode, it pulls the sda0 pin low during that clock cycle to generate an acknowledge signal. when sbi0cr1 is set to 0, the serial bus interface operates in non-acknowledgment mode: when operating as the master, it does not add a clock cycle for an acknowledge signal. when operating as a slave, it does not count a clock cycle for an acknowledge signal. (2) selecting the number of bits to be transferred the number of bits to be transmitted or re ceived is selected using sbi0cr1 . the slave address and the direction bit are always transferred in eight bits because the start condition clears sbi0cr1 to 000. in other case s, sbi0cr1 maintains the value once it has been set. (3) serial clock a. clock source the sbi0cr1 bits select the ma ximum transfer frequency for the serial clock that is output through the scl0 pin in master mode. formula sbi0cr1 n t low = 2 n-1 / fc t high = 2 n-1 / fc + 8 / fc fscl = 1 / (t low + t high ) = fc / (2 n + 8) 0011 0100 0101 0110 8 9 10 11 t low = 32 / fc, t high = 18 / fc fscl = fc / 50 1000 ? t low = 100 / fc, t high = 100 / fc fscl = fc / 200 1111 ? figure 3.10.15 clock source t high t low 1/fscl
tmp92cd54i 2009-12-26 92cd54i-165 tentative b. clock synchronization the i 2 c bus is driven in a wired-and manner due to the pin structure. therefore, the first master that has pulled the clock line low disables the clock for any other master outputting a high level. the master outp utting a high level should detect that condition and take appropriate action. the tmp92cd54i supports clock synchronization to ensure normal transfer even if multiple masters with different transfer rates exist on the bus. the following describes an example clock synchronization procedure when two masters are simultaneously operating on the bus: internal scl0 output (master a) internal scl0 output (master b) scl0 line reset a counter of high-level width of a clock pulse w a it coun ti ng hi g h - l eve l width of a clock pulse start couting high-level width of a clock pulse a b c figure 3.10.16 cloc k synchronization at point "a", master a pulls its internal scl0 output low, causing the scl0 line on the bus to be driven low. detecting that transition, master b resets the high period count and pulls its internal scl0 output low. at point "b", master a completes counting th e low period and drives its internal scl0 output high. however, since master b is maintaining the scl0 bus line low, master a stops counting the high period. at point "c", master b drives its internal scl0 output high, causing the scl0 bus line to be driven high. upon detecting that transition, master a starts counting the high period. as shown above, when more than one master is connected on the bus, the clock on the bus is determined by the master with the shortest high period and that with the longest low period. c. effects of the scl rise time on the transfer rate clock synchronization inserts a wait time for the rise time on the scl line. in that case, the actual transfer rate is slower than the value described in the data sheet. the following shows details and examples:
tmp92cd54i 2009-12-26 92cd54i-166 tentative scl-period (t-period ) = t-low + t-high t-high = t-r + thigh, t-r = tr + [wait time for counting at high level] sck3:0 (0001 0110) 2 n ? 1 /fc t-r (2 n ? 1 + 8)/fc sck3:0 (1111) : 100khz at fc=20mhz 100/fc t-r 100/fc sck3:0 (1000) : 400khz at fc=20mhz 32/fc t-r 18/fc t r 0~2/fc 2/fc~4/fc 4/fc~6/fc 6/fc~8/fc 8/fc~10/fc sck3:0 (0001 0110) t-r 0 4/fc 8/fc sck3:0 (1111) : 100khz t-r 0 4/fc 8/fc sck3:0 (1000) : 400khz t-r 0 2/fc 4/fc 6/fc 8/fc figure 3.10.17 insert wait time (t-r) by rising time of scl0 line (t r ) if the scl0 rise time, tr, is less than 2/fc, a synchronization wait time is not inserted. if it is 2/fc or greater, t-high is extended by the period of t-r, resulting in a slower transfer rate. example1: (1) in the case, fc = 20mhz, = 0011 and t r = 50ns: t-r = 0ns. since t r = 50ns. t-period = 2 n ? 1 /fc + 0 + (2 n ? 1 + 8)/fc = 266/fc = 13.2 s (75.8khz) (2) in the case, fc = 20mhz, = 0011 and t r = 250ns: t-r = 4/fc, since t r = 250ns. t-period = 2 n ? 1 /fc + 4/fc + (2 n ? 1 + 8)/fc = 268/fc = 13.4 s (74.6khz) example2: (1) in the case, fc = 20mhz, = 1111 and t r = 50ns: t-r = 0ns, since t r = 50ns. t-period = 100/fc + 0 + 100/fc = 10 s (100khz) (2) in the case, fc = 20mhz, = 1111 and t r = 150ns: t-r = 4/fc, since t r = 150ns. t-period = 100/fc + 4/fc + 100/fc = 10.2 s (98.0khz) example3: (1) in the case, fc = 20mhz, = 1000 and t r = 50ns: t-r = 0ns, since t r = 50ns. t-period = 32/fc + 0 + 18/fc = 2.5 s (400khz) (2) in the case, fc = 20mhz, = 1000 and t r = 150ns: t-r = 2/fc, since t r = 150ns. t-period = 32/fc + 2/fc + 18/fc = 2.6 s (384.6khz) (4) setting the slave address and address recognition mode to operate the tmp92cd54i as a slave device, set the slave address and in i2c0ar. clearing i2c0ar to 0 selects addre ss recognition mode (a ddressing format). (5) selecting the master or slave setting sbi0cr2 to 1 causes the tmp92cd54i to operate as a master device. clearing sbi0cr2 to 0 causes the tm p92cd54i to operate as a slave device. sbi0cr2 is cleared by hardware upon the detection of a stop condition or arbitration lost on the bus. scl0 line t-low t-high t r t f tlow thigh t-r
tmp92cd54i 2009-12-26 92cd54i-167 tentative (6) selecting the transmitter or receiver sbi0cr2 selects either transmitter or receiver operation. setting to 1 causes the tmp92cd54i to operate as a tr ansmitter. setting to 0 causes the tmp92cd54i to operate as a receiver. when transferring data using the addressing format in slave mode, the device receives the slave address and direction bit in the first byte. if the received slave address matches the value of i2c0ar (the device's slave address), the value of varies according to the direction bit. if w/r = 0 (slave reception), is cleared to 0 and an acknowledge signal is returned to receive subsequent data. if r/w = 1 (slave transmission), is set to 1 and an acknowledge signal is returned to transmit subsequent data. for a general call, where all bits of the first byte are 0, r/w = 0 so that is cleared to 0 and an acknowledge signal is returned to receive subsequent data. in master mode, when an acknowledge signal is returned from the slave device, the value of varies depending on the value of r/w that has been sent. if r/w = 0 (master transmission), is set to 1. if r/w = 1 (master reception), is cleared to 0. if no acknowledge signal is returned, maintains the previous value. is cleared by hardware upon the detectio n of a stop condition or arbitration lost on the i 2 c bus. (7) generating start and stop conditions when sbi0sr is 0, writing 1111 to sbi0cr2 causes a start condition and the 8-bit data in sbi0dbr to be output on the bus. sbi0cr1 must be set to 1 before the start condition. scl0 line start condition a6 slave address and the direction bit a cknowledge signal 1 sda0 line 2 345678 9 a5 a4 a3 a2 a1 a0 wr / figure 3.10.18 start condition generation and slave address generation when sbi0sr is 1, writing 111 to sbi0cr2 and 0 to sbi0cr2 causes a stop condition output sequence to start on the bus. do not rewrite the contents of sbi0cr2 until a stop condition occurs on the bus. stop condition scl0 line sda0 line figure 3.10.19 stop condition generation the bus status can be determined by reading sbi0sr . sbi0sr is set to 1 if a start condition is detected on the bus (bus busy state) and cleared to 0 if a stop condition is detected on the bus (bus free state). when the sbi0sr flag changes its state from 1 to 0 (falling edge), intsbs0 occurs.
tmp92cd54i 2009-12-26 92cd54i-168 tentative (8) issuing and releasing an interrupt service request when serial bus interface interrupt request 0 (intsbe0) is issued due to a slave address or data transfer, sbi0sr is cleared to 0. the scl0 line is pulled low while sbi0sr is 0. sbi0sr is cleared to 0 once a single word has been transmitted or received. it is set to 1 once data has been written to sbi0dbr or read from sbi0dbr. it requires a time of tlow between sbi0sr being set to 1 and the scl0 line being relinquished. in address recognition mode (i2c0ar = 0), sbi0cr2 is cleared to 0 if the received slave address matches the value set in i2c0ar or when a general call (where all bits of the 8-bit data after the start condition are 0) is received. a program can write a 1 to sbi0cr2 to set it to 1. when it writes a 0, however, the bit is not cleared to 0. (9) operating mode of the serial bus interface the sbi0cr2 bits specify the operating mode of the serial bus interface. to use it in i 2 c bus mode, set sbi0cr2 to 10. ensure that the bus is free before attempting to change the operating mode to port mode. (10) arbitration lost detection monitor the i 2 c bus allows multi-master operation (two or more masters can simultaneously exist on a single bus), thus requiring a bus arbitr ation procedure to guarantee the contents of transferred data. the i 2 c bus uses data on the sda0 line for bus arbitration. the following describes an example arbitration procedure when two masters are simultaneously operating on the bus: both masters a and b output the same data up until the bit at point "a". at point "a", master a outputs a low level while master b outputs a high level. since the sda0 line on the bus is driven in a wired-and manner, it is pulled low by master a. when the scl0 bus line rises at point "b", the slave device fetches data on the sda0 line, that is, data from master a. at this time, data output from master b is invalid. that state of master b is called "arbitration lost." master b relinquishes the sda pin to prevent it from affecting data output from other masters. if more than one master transmits exactly the same data in the first word, the arbitration procedure continues for the second and subsequent words. internal sda0 output becomes ?1? after arbitration has been lost. scl0 line internal sda0 output (master a) internal sda0 output (master b) sda0 line ab figure 3.10.20 arbitration lost
tmp92cd54i 2009-12-26 92cd54i-169 tentative the level of the sda0 bus line is compared with the internal sda0 output level on the rising edge of the scl0 line. if they do not ma tch, sbi0sr is set to 1 to indicate the arbitration lost state. when sbi0sr is set to 1, the sbi0sr bits are reset to 00, causing a transition to slave receive mode. the serial clock is, however, output until the end of data transfer that was being transmitted when sbi0sr changed to 1. sbi0sr is reset to 0 by writing data to sbi0dbr, reading data from sbi0dbr, or writing data to sbi0cr2. stop the clock pulse 1 keep internal sda0 output to high-level as losing arbitration a ccessed to sbi0dbr or sbi0cr2 internal sda0 output internal scl0 output master a master b 2 3 456789 1 2 3 4 d7a d6b d4a d3a d2a d1a d0a d7a? d6a? d5a? d4a? 1 2 3 d7b d6a internal sda0 output internal scl0 output d5a figure 3.10.21 example of a master device b (d7a = d7b, d6a = d6b) (11) slave address match detection monitor in slave mode, sbi0sr is set to 1 if the device receives a general call or the same slave address as that set in i2c0ar in address recognition mode (i2c0ar = 0). if i2c0ar = 1, sbi0sr is set to 1 when the first word is received. sbi0sr is cleared to 0 by writing data to sbi0dbr or reading data from sbi0dbr. (12) general call detection monitor in slave mode, sbi0sr is set to 1 when a general call (where all bits of the 8-bit data after the start condition are 0) is received, and cleared to 0 when a start or stop condition is detected on the bus. (13) last received bit monitor the value on the sda0 line is captured on the rising edge of the scl0 line and set in sbi0sr . in acknowledgment mode, reading sbi0sr immediately after an intsbe0 interrupt request is issued result s in the ack signal being read.
tmp92cd54i 2009-12-26 92cd54i-170 tentative (14) software reset if the serial bus interface circuit is locked due to external noise, the software reset function can be used to initialize the serial bus interface circuit. to initialize the serial bus interface circ uit, first write 10 and then 01 to sbi0cr2 , causing a reset signal to be applie d to the circuit. this initializes the values in all control and status registers. initializing the serial bus interface causes to be automatically cleared to 00. note: initialization requires approximately 1.4 s (when fc = 20 mhz). sbi0cr1 can be monitored to determine whethe r initialization has been completed. (15) serial bus interface data buffer register (sbi0dbr) sbi0dbr is read or written to read received data or write transmit data. in master mode, the device ge nerates a start condition after the slave address and direction bit are sets in this register. (16) i 2 c bus address register (i2c0ar) the i2c0ar bits set a slave address when the tmp92cd54i operates as a slave device. if i2c0ar is set to 0, the tmp92cd54i recognizes the slave address output from the master device and uses the addressing data format. if i2c0ar is set to 1, the tmp92cd54i does not recognizes the slave address and uses the free data format. (17) baud rate register (sbi0br1) it is necessary to write a 1 to sbi0br1 before attempting to use the i 2 c bus. (18) idle2 setup register (sbi0br0) the sbi0br0 bit enables or disable the operation when the tmp92cd54i enters idle2 mode. it is necessary to set this bit before at tempting to execute the halt instruction.
tmp92cd54i 2009-12-26 92cd54i-171 tentative 3.10.6 data transfer procedure in i 2 c bus mode (1) initializing the device first, it is necessary to set sbi0br1 and sbi0cr1 . write a 1 to sbi0br1 and 0s to sbi0cr1 bits 7, 6, 5 and 3. next, set (slave addr ess) and (0 for the a ddressing format) in i2c0ar. then, write 000 to sbi0cr2 , 1 to , 10 to , 00 to , and set the initial state to slave receiver mode. (2) generating a start condition and slave address a. in master mode in master mode, a start condition and slave address are generated using the following procedure: first, ensure that the bus is free (sbi0cr2 = 0). next, write a 1 to sbi0cr1 to select acknowledgment mode. in sbi0dbr, write the slave address and the direction bit to which data will be transmitted. when sbi0cr2 is 0, writing 1111 to sbi0cr2 causes a start condition to be generated on the bus. following the start condition, output nine clock cycles on the scl0 pin. in the first eight clock cycles, output the slave address and direction bit stored in sbi0dbr. in the ninth clock cycle, relinquish the sda0 line and receive an acknowledge signal from the slave device. on the falling edge of the ninth clock cycl e, an intsbe0 interrupt request occurs and sbi0cr2 is cleared to 0. in master mode, pull the scl0 line low while sbi0cr2 is 0. only when an acknowledge signal is returned from the slave device, an intsbe0 interrupt request occurs and the value of sbi0cr2 changes depending on the direction bit transmitted. b. in slave mode in slave mode, a start condition and slave address are received. after receiving a start condition from the master device, receive the slave address and direction bit from the master device in the first eight clock cycles on the scl0 line. if the received address indicates a general call or matches the sl ave address set in i2c0ar, pull the sda0 line low in the ninth clock cycle to output an acknowledge signal. on the falling edge of the ninth clock cycl e, an intsbe0 interrupt request occurs and sbi0cr2 is cleared to 0. in slave mode, pull the scl0 line low while sbi0cr2 is 0. only when an acknowledge signal is returned from the slave device, an intsbe0 interrupt request occurs and the value of sbi0cr2 changes depending on the direction bit received. scl0 start condtion a6 slave address + derection bit a cknowledge signal from a slave device 1 sda0 2 345678 9 a5 a4 a3 a2 a1 a0 w r/ intsbe0 interrupt request a ck output of master output of slave figure 3.10.22 start condition generation and slave address transfer
tmp92cd54i 2009-12-26 92cd54i-172 tentative (3) transferring a single word of data when handling an intsbe0 interrupt upon the end of transferring a single word, test sbi0cr2 to determine whether the mode is master or slave mode. a. in master mode (sbi0cr2 = 1) test sbi0cr2 to determine whether the tmp92cd54i is the transmitter or receiver. in transmitter mode (sbi0cr2 = 1) test sbi0sr. if sbi0sr = 1, the receiver is not requesting data. in that case, generate a stop condition (see 3.10 .6 (4)) and comple te data transfer. if sbi0sr is 0, the receiver is requesting next data. if the data to be transferred next consists of eight bits, write the transfer data to sbi0dbr. it the data consists of other than eight bits, set sbi0cr1 and before writing the transfer data to sbi0dbr. once the data has been written, sbi0sr is set to 1, after which the scl0 pin generates a serial clock for transferring the next word of data and the sda0 pin transfers the word. upon the completion of transfer, an intsbe0 interrupt request occurs, sbi0sr is set to 0, and the scl0 line is pulled low. to transfer multiple words, repeat the above sbi0sr test and subsequent steps. scl0 line d7 a cknowledge signal from a receive 1 sda0 line 2 3 456789 d6 d5 d4 d3 d2 d1 intsbe0 interrupt request ack output from master output from slave d0 write to sbi0dbr figure 3.10.23 example in which = ?000? and = ?1? in transmitter mode
tmp92cd54i 2009-12-26 92cd54i-173 tentative in receiver mode (sbi0sr = 0) if the data to be transferred consists of other than eight bits, set sbi0cr1 and and read the received data from sbi0dbr to relinquish the scl0 line (the data is undefined if it is read immediately after the slave address is transmitted). reading data causes sbi0cr2 to be se t to 1 and a serial clock for transferring the next data word to be output on the scl0 pin. for the last bit, a 0 is output on the sda0 pin when the acknowledge signal goes low. then, an intsbe0 interrupt request occurs, sbi0cr2 is set to 0, and the scl0 line is pulled low. a transfer clock for a single word and an acknowledge signal are output every time the received data is read from sbi0dbr. scl0 d7 a cknowledge signal to a transmitter 1 sda0 2 3 45678 9 d6 d5 d4 d3 d2 d1 intsbe0 interrupt reques t ack output from master output from slave d0 read sbi0dbr new d7 figure 3.10.24 example of when = ?000?, = ?1? in receiver mode to request the transmitter to terminate da ta transmission, clea r sbi0cr1 to 0 before reading the word of data preceding the word to be received last. this prevents a clock for acknowledging the last data from being generated. during processing after the transfer end interrupt request is issu ed, set sbi0cr1 to 001 and read data, which causes a clock for single-bit tran sfer to be generated. at this time, the master is the receiver so that the sda0 line on the bus remains high level. the transmitter receives this high level as an ack signal, with which the receiver can notify the transmitter of th e completion of transfer. during processing after the reception end inte rrupt request for that single-bit transfer, generate a stop condition to complete data transfer. the generation of the stop condition (see 3.10.6 (4)) causes an intsbs0 interrupt request. scl0 line d7 a cknowledge signal sent to a transmitter 1 sda0 line 2 3 45678 1 d6 d5 d4 d3 d2 d1 intsbe0 interrupt request output of master output of slave d0 ?0? read sbi0dbr 9 ?001? read sbi0dbr figure 3.10.25 termination of data transfer in master receiver mode
tmp92cd54i 2009-12-26 92cd54i-174 tentative b. in slave mode (sbi0cr2 = 0) processing in slave mode is classified in to processing normally performed in slave mode and processing performed when the device detects arbitration lost and enters slave mode. the following describes when an intsbe0 interrupt request is issued in each case: ? in normal slave mode: (1) when the addressing format is used and the received slave address matches the address set in i2car. alternatively, when a general call is received. (2) when data transfer has been completed ? if the device changes from master mode to slave mode due to arbitration lost: (1) when the transfer of the word with which arbitration lost was detected is completed when an intsbe0 interrupt request occurs, sbi0cr2 is cleared to 0, and the scl0 line is pulled low. once data is written to or read from sbi0dbr or sbi0cr2 is set to 1, the scl0 pin is relinquished in a period of t low . note: sbi0cr2 is set to 0 and the scl0 pin is pulled low only if the tmp92cd54i detects arbitration lost while transmi tting a slave address as a master and the tmp92cd54i itself is called as a slave device (slave address match). if it detects arbitration lost while transmitti ng a slave address as a master but the slave address does not match, or if it detects ar bitration lost while transmitting data as a master, an intsbe0 interrupt request occurs upon the completion of transferring the word with which arbitration lost was detect ed, but sbi0cr2 is not cleared to 0. when the sbi0sr flag changes its state from 1 to 0 (falling edge), intsbs0 occurs. in slave mode, test the sbi0sr , , , and bits and then determine the status from the combination of those values to take appropriate action. table 3.10.3 shows the states in slave mode and required operations.
tmp92cd54i 2009-12-26 92cd54i-175 tentative table 3.10.3 operation in the slave mode conditions process 1 1 0 in the master transmitter mode, this device detects the arbitration lost during transferring the slave address. it turns into the slave receiver mode. after that this device finishes receiving from other masters the slave address which is the same as that of this device and the direction bit ?1?. 1 0 in the slave receiver mode, this device finishes receiving from master the slave address which is the same as that of this device and the direction bit ?1?. this device operates in the slave transmitter mode. set the number of bits in 1-word to the and write the transmitted data to the sbi0dbr. ( is set to ?1? and scl0 is released.) 1 0 0 0 in the slave transmitter mode, this device finishes tr ansmitting 1-word data. this device operates in the slave transmitter mode. check the . if the is set to ?1?, set the to ?1? since the receiver does not request the next data. then, clear the to ?0? to release the bus. if the is cleared to ?0?, set the number of bits in 1-word to the and write transmitted data to the sbi0dbr since the receiver requests next data. 1 1/0 in the master transmitter mode, this device detects the arbitration lost during transferring the slave address. it turns into the slave receiver mode. after that this device finishes receiving from other masters the slave address which is the same as that of this device and the direction bit ?0? or receiving the general call. this device operates in the slave receiver mode. read the sbi0dbr to set the to ?1? (reading dummy data) or set the to ?1?. 1 0 0 in the master transmitter mode, this device detects the arbitration lost during transferring the slave address. it turns into the slave receiver mode. after that this device finishes receiving from other masters the slave address which is not the same as that of this device and the direction bit. (the is not cleared to ?0?.) this device operates in the slave receiver mode. the is not cleared to ?0?. in case that this device transmits again as a master, set up with software. 1 1/0 in the slave receiver mode, this device finishes receiving from master the slave address which is the same as that of this device and the direction bit ?0? or receiving the general call. this device operates in the slave receiver mode. read the sbi0dbr to set the to ?1? (reading dummy data) or set the to ?1?. 0 0 0 1/0 in the slave receiver mode, this device finishes receiving 1-word data. this device operates in the slave receiver mode. set the number of bits in 1-word to the and read the received data in the sbi0dbr. ( is set to ?1? and scl0 is released.)
tmp92cd54i 2009-12-26 92cd54i-176 tentative (4) generating a stop condition when sbi0sr is 1, writing 111 to sbi0cr2 and 0 to causes a stop condition output sequence to start on the bus. do not rewrite the contents of sbi0cr2 until a stop condition occurs on the bus. if the scl0 line on the bus has already been pulled by another device, the sda0 line rises after the scl0 line is relinquished, thus gene rating a stop condition. when sbi0sr is cleared to 0, an intsbs0 interrupt request is issued as a result of a stop condition. scl0 line sda0 line (read) stop condition 1 1 0 1 intsbs0 interrupt request figure 3.10.26 stop condition generation
tmp92cd54i 2009-12-26 92cd54i-177 tentative (5) restart procedure the restart procedure is used when the master device changes the direction of transfer for the slave device without terminating data transfer. the following describes the procedure for performing a restart in master mode. first, write 000 to sbi0cr2 and 1 to to relinquish the bus. at this time, the sda0 pin maintains a high level and the scl0 pin is relinquished so that the bus is still busy as viewed from other devices because no stop condition occurs. then, test sbi0sr and wait until it becomes 0 to determine that the scl0 pin has been relinquished. next, test sbi0sr and wait until it becomes 1 to determine that no other device is pulling the scl0 bus line low. after determining that the bus is free using the above steps, generate a start co ndition as described in 3.10.6 (2). to satisfy the setup time condition for a restar t, a software wait time is required between the bus free state being determined and a start condition being generated. the time is at least 600 ns in fast mode or at least 4.7 s in standard mode. 0 0 0 1 1 1 1 1 scl0 line internal scl0 outpu t sda0 line fast : 600[ns](min.) standard: 4.7 [ s](min.) start codnition 9 figure 3.10.27 timing diagram when restarting
tmp92cd54i 2009-12-26 92cd54i-178 tentative 3.10.7 control in clock synchronous 8-bit sio mode the following registers are used to contro l the serial bus interface and monitor its operating state in clock synchronous 8-bit sio mode: serial bus interface 0 control register 1 7 6 5 4 3 2 1 0 bit symbol sios sioinh siom1 siom0 - sck2 sck1 sck0 read/write w w w after reset 0 0 0 0 1 0 0 0 function transfer start 0: stop 1: start continue/ abort transfer 0: continue transfer 1: abort transfer transfer mode select 00: transmit mode 01: (reserved) 10: transmit/receive mode 11: receive mode note2) write 0 to this bit. serial clock selection serial clock selection @ write 000 001 010 011 100 101 110 111 n = 4 n = 5 n = 6 n = 7 n = 8 n = 9 n = 10 ? 1.25 mhz 625 khz 313 khz 156 khz 78.1 khz 39.1 khz 19.5 khz external clock : cpu clcok: fc fc = 20 mhz (output to sck pin) fscl = [hz] transfer mode selection 00 8-bit transmit mode 01 (reserved) 10 8-bit transmit / receive mode 11 8-bit receive mode continue / abort transfer 0 continue transfer 1 abort transfer (automatically cleared after transfer aborted) indicate transfer start / stop 0 stop 1start sbi0cr1 (0170h) note1: when using sio mode, write a 0 to this bit. note2: after setting the transfer mode and serial clock, write a 1 to to start transfer. to set the transfer mode and serial clock, first set to 0 and to 1. fc 2 n sck0 read- modify- write not allowed serial bus interface 0 data buffer register 7 6 5 4 3 2 1 0 bit symbol rb7/tb7 rb6/tb6 rb5/tb5 r b4/tb4 rb3/tb3 rb2/tb2 rb1/tb1 rb0/tb0 read/write r (receiver) / w (transfer) after reset undefined figure 3.10.28 register for the sio mode sbi0dbr (0171h) read- modify- write not allowed
tmp92cd54i 2009-12-26 92cd54i-179 tentative serial bus interface 0 control register 2 7 6 5 4 3 2 1 0 bit symbol - - - - sbim1 sbim0 - - read/write w w w after reset - - - - 0 0 0 0 function serial bus interface operation mode selection 00: port mode 01: sio mode 10: i 2 c bus mode 11: (reserved) (note2) (note2) serial bus interface operation mode selection 00 port mode (serial bus interface output disabled) 01 clocked-synchronous 8-bit sio mode 10 i 2 c bus mode 11 (reserved) note1: sbi0cr2<1:0> must always be set to 00. note2: it is necessary to clear sbi0cr1 to 000 before attempting to change the operating mode to clock synchronous 8-bit sio mode. serial bus interface 0 status register 7 6 5 4 3 2 1 0 bit symbol - - - - siof sef - - read/write r after reset - - - - 0 0 - - function serial transfer operation status monitor shift operation status monitor shift operation status monitor 0 shift operation terminated 1 shift operation in progress serial transfer operating status monitor 0 transfer terminated sbi0cr2 (0173h) sbi0sr (0173h) read- modify- write not allowed figure 3.10.29 regist ers for the sio mode
tmp92cd54i 2009-12-26 92cd54i-180 tentative serial bus interface 0 baud rate register 0 7 6 5 4 3 2 1 0 bit symbol - i2sbi0 - - - - - - read/write w r/w after reset 0 0 - - - - - - function (note) fixed to ?0? idle2 0: stop 1: run operation during idle 2 mode 0 stop 1 operate serial bus interface 0 baud rate register 1 7 6 5 4 3 2 1 0 bit symbol p4mon/ p4en - - - - - - - read/write r/w after reset 0 - - - - - - - function internal clock 0: stop 1: operate baud rate clock control 0 stop 1 operate sbi0br0 (0174h) sbi0br1 (0175h) figure 3.10.30 regist ers for the sio mode
tmp92cd54i 2009-12-26 92cd54i-181 tentative serial bus interface 1 control register 1 7 6 5 4 3 2 1 0 bit symbol sios sioinh siom1 siom0 - sck2 sck1 sck0 read/write w w w after reset 0 0 0 0 1 0 0 0 function transfer start 0: stop 1: start continue/ abort transfer 0: continue transfer 1: abort transfer transfer mode select 00: transmit mode 01: (reserved) 10: transmit/receive mode 11: receive mode note2) write 0 to this bit. serial clock selection serial clock selection @ write 000 001 010 011 100 101 110 111 n = 4 n = 5 n = 6 n = 7 n = 8 n = 9 n = 10 ? 1.25 mhz 625 khz 313 khz 156 khz 78.1 khz 39.1 khz 19.5 khz external clock : cpu clcok: fc fc = 20 mhz (output to sck pin) fscl = [hz] transfer mode selection 00 8-bit transmit mode 01 (reserved) 10 8-bit transmit / receive mode 11 8-bit receive mode continue / abort transfer 0 continue transfer 1 abort transfer (automatically cleared after transfer aborted) indicate transfer start / stop 0 stop 1start serial bus interface 1 data buffer register 7 6 5 4 3 2 1 0 bit symbol rb7/tb7 rb6/tb6 rb5/tb5 rb4/tb4 rb3/tb3 rb2/tb2 rb1/tb1 rb0/tb0 read/write r (receiver) / w (transfer) after reset undefined read- modify- write not allowed note1: when using sio mode, write a 0 to this bit. note2: after setting the transfer mode and serial clock, write a 1 to to start transfer. to set the transfer mode and serial clock, first set to 0 and to 1. sbi1dbr (0179h) fc 2 n sck1 sbi1cr1 (0178h) read- modify- write not allowed figure 3.10.31 register for the sio mode
tmp92cd54i 2009-12-26 92cd54i-182 tentative serial bus interface 1 control register 2 7 6 5 4 3 2 1 0 bit symbol - - - - sbim1 sbim0 - - read/write w w w after reset - - - - 0 0 0 0 function serial bus interface operation mode selection 00: port mode 01: sio mode 10: i 2 c bus mode 11: (reserved) (note2) (note2) serial bus interface operation mode selection 00 port mode (serial bus interface output disabled) 01 clocked-synchronous 8-bit sio mode 10 i 2 c bus mode 11 (reserved) note1: sbi1cr2<1:0> must always be set to 00. note2: it is necessary to clear sbi1cr1 to 000 before attempting to change the operating mode to clock synchronous 8-bit sio mode. serial bus interface 1 status register 7 6 5 4 3 2 1 0 bit symbol - - - - siof sef - - read/write r after reset - - - - 0 0 - - function serial transfer operation status monitor shift operation status monitor shift operation status monitor 0 shift operation terminated 1 shift operation in progress serial transfer operating status monitor 0 transfer terminated sbi1cr2 (017bh) sbi1sr (017bh) read- modify- write not allowed figure 3.10.32 regist ers for the sio mode
tmp92cd54i 2009-12-26 92cd54i-183 tentative serial bus interface 1 baud rate register 0 7 6 5 4 3 2 1 0 bit symbol - i2sbi1 - - - - - - read/write w r/w after reset 0 0 - - - - - - function (note) fixed to ?0? idle2 0: stop 1: run operation during idle 2 mode 0 stop 1 operate serial bus interface 1 baud rate register 1 7 6 5 4 3 2 1 0 bit symbol p4mon/ p4en - - - - - - - read/write r/w after reset 0 - - - - - - - function internal clock 0: stop 1: operate baud rate clock control 0 stop 1 operate sbi1br0 (017ch) sbi1br1 (017dh) figure 3.10.33 regist ers for the sio mode
tmp92cd54i 2009-12-26 92cd54i-184 tentative serial bus interface 2 control register 1 7 6 5 4 3 2 1 0 bit symbol sios sioinh siom1 siom0 - sck2 sck1 sck0 read/write w w w after reset 0 0 0 0 1 0 0 0 function transfer start 0: stop 1: start continue/ abort transfer 0: continue transfer 1: abort transfer transfer mode select 00: transmit mode 01: (reserved) 10: transmit/receive mode 11: receive mode note2) write 0 to this bit. serial clock selection serial clock selection @ write 000 001 010 011 100 101 110 111 n = 4 n = 5 n = 6 n = 7 n = 8 n = 9 n = 10 ? 1.25 mhz 625 khz 313 khz 156 khz 78.1 khz 39.1 khz 19.5 khz external clock : cpu clcok: fc fc = 20 mhz (output to sck pin) fscl = [hz] transfer mode selection 00 8-bit transmit mode 01 (reserved) 10 8-bit transmit / receive mode 11 8-bit receive mode continue / abort transfer 0 continue transfer 1 abort transfer (automatically cleared after transfer aborted) indicate transfer start / stop 0 stop 1start serial bus interface 2 data buffer register 7 6 5 4 3 2 1 0 bit symbol rb7/tb7 rb6/tb6 rb5/tb5 rb4/tb4 rb3/tb3 rb2/tb2 rb1/tb1 rb0/tb0 read/write r (receiver) / w (transfer) after reset undefined note1: when using sio mode, write a 0 to this bit. note2: after setting the transfer mode and serial clock, write a 1 to to start transfer. to set the transfer mode and serial clock, first set to 0 and to 1. sbi2dbr (0181h) fc 2 n sck2 sbi2cr1 (0180h) read- modify- write not allowed read- modify- write not allowed figure 3.10.34 register for the sio mode
tmp92cd54i 2009-12-26 92cd54i-185 tentative serial bus interface 2 control register 2 7 6 5 4 3 2 1 0 bit symbol - - - - sbim1 sbim0 - - read/write w w w after reset - - - - 0 0 0 0 function serial bus interface operation mode selection 00: port mode 01: sio mode 10: i 2 c bus mode 11: (reserved) (note2) (note2) serial bus interface operation mode selection 00 port mode (serial bus interface output disabled) 01 clocked-synchronous 8-bit sio mode 10 i 2 c bus mode 11 (reserved) note1: sbi2cr2<1:0> must always be set to 00. note2: it is necessary to clear sbi2cr1 to 000 before attempting to change the operating mode to clock synchronous 8-bit sio mode. serial bus interface 2 status register 7 6 5 4 3 2 1 0 bit symbol - - - - siof sef - - read/write r after reset - - - 0 0 - function serial transfer operation status monitor shift operation status monitor shift operation status monitor 0 shift operation terminated 1 shift operation in progress serial transfer operating status monitor 0 transfer terminated sbi2cr2 (0183h) sbi2sr (0183h) read- modify- write not allowed figure 3.10.35 regist ers for the sio mode
tmp92cd54i 2009-12-26 92cd54i-186 tentative serial bus interface 2 baud rate register 0 7 6 5 4 3 2 1 0 bit symbol - i2sbi1 - - - - - - read/write w r/w after reset 0 0 - - - - - - function (note) fixed to ?0? idle2 0: stop 1: run operation during idle 2 mode 0 stop 1 operate serial bus interface 2 baud rate register 1 7 6 5 4 3 2 1 0 bit symbol p4mon/ p4en - - - - - - - read/write r/w after reset 0 - - - - - - - function internal clock 0: stop 1: operate baud rate clock control 0 stop 1 operate sbi2br0 (0184h) sbi2br1 (0185h) read- modify- write not allowed figure 3.10.36 regist ers for the sio mode
tmp92cd54i 2009-12-26 92cd54i-187 tentative (1) serial clock a. clock source the following clock sources can be selected using sbi0cr1 . internal clock in internal clock mode, one of seven freque ncies can be selected. the serial clock is supplied to an external device through the sc k0 pin. at the start of transfer, the sck0 pin output is high. if a data write (for transmission) or a data read (for reception) in the program cannot keep up with the serial clock rate, the automatic wait function stops the serial clock automatically and delays the next shift operation until the processing is completed. sck0 pin output so0 pin output write transmitted data 3 1 7 2 8 1 2 6 7 8 1 2 3 c 0 ab c a utomatic wait function a 0 a 1 a 2 a 5 a 6 a 7 b 0 b 5 b 6 b 7 c 1 c 2 b 1 b 4 figure 3.10.37 automatic-wait function external clock (sbi0cr1 = 111) in this mode, an external clock supplied through the sck0 pin is used as the serial clock. to ensure that shift operation is performed norm ally, the high and low widths of the serial clock must satisfy the following condition. the maximum transfer frequency is, therefore, 1.25 mhz (when fc = 20 mhz). t sckh t sckl , t sckh > 8/fc sck0 pin t sckl figure 3.10.38 maximum data transfer frequency when external clock input
tmp92cd54i 2009-12-26 92cd54i-188 tentative b. shift edge data is transmitted using a leading-edge shift and received using a trailing-edge shift. leading-edge shift data is shifted on the leading edge of the serial clock (falling edge of the sck0 pin input/output). trailing-edge shift data is shifted on the trailing edge of the serial clock (rising edge of the sck0 pin input/output). bit 0 bit 1 bit 2 bit 3 bit 4 bit 5 bit 6 bit 7 76543210 * 7654321 ** 765432 *** 76543 **** 7654 ***** 765 ****** 76 ****** 7 so0 pin output 6543210 * 543210 ** 0 ******* 10 ****** 210 ***** 3210 **** 43210 *** ******** 76543210 sck0 pin output shift register sck0 pin si0 pin shift register (a) falling edge shift (b) rising edge shift note: * = don?t care bit 0 bit 1 bit 2 bit 3 bit 4 bit 5 bit 6 bit 7 figure 3.10.39 shift edge
tmp92cd54i 2009-12-26 92cd54i-189 tentative (2) transfer modes the sbi0cr1 bits select the transfer mode: transmit, receive, or transmit/receive. a. 8-bit transmit mode after specifying transmit mo de in the control register, write transmit data to sbi0dbr. then, setting sbi0cr1 to 1 causes tran smission to start. the transmit data is moved from sbi0dbr to the shift register and then, in synchronization with the serial clock, output through the so0 pin in an lsb-first manner. once the transmit data has been moved to the shift register, sbi0dbr becomes empty, thus causing an intsbe0 interrupt (buffer empty) to occur that requests next transmit data. in internal clock operation, if next data is not set after all of 8-bit data has been transmitted, the serial clock is stopped for automatic wait. writing next transmit data terminates automatic wait. in external clock operation, data must be written to sbi0dbr before shift operation for next data starts. the transfer rate is, therefore, determined from the maximum delay between an interrupt request being issued and data being written to sbi0dbr in the interrupt handling routine. at the beginning of transmission, the same value as the last bit of the data transmitted last is output between sbi0sr being set to 1 and the falling edge of sck0. to terminate transmission, either set sb i0cr1 to 0 or sbi0cr1 to 1 in the intsbe0 interrupt handling routine. if sbi0cr1 is cleared, transmission is terminated once all data has been output. the program can determine the termination of transmission using sbi0sr . sbi0sr is set to 0 upon the termination of transmission. setting sbi0cr1 to 1 causes transmission to be aborted immediately and sbi0cr1 to be cleared to 0. in external clock operation, sbi0cr1 must be cleared to 0 before shift operation for next transmit data starts. if sbi0cr1 is not cleared before shift-out operation starts, the serial bus interface transmits dummy data and then stops.
tmp92cd54i 2009-12-26 92cd54i-190 tentative sbi0dbr intsbe0 interrupt request sck0 pin (output) so0 pin b a 0 a 1 a 2 a 3 a 4 a 5 a 6 a 7 b 0 b 1 b 2 b 3 b 4 b 5 b 6 b 7 * clear a write transmitted data (a) internal clock sbi0dbr intsbe0 interrupt request sck0 pin (input) so0 pin b a 0 a 1 a 2 a 3 a 4 a 5 a 6 a 7 b 0 b 1 b 2 b 3 b 4 b 5 b 6 b 7 * clear a write transmitted data (b) external clock figure 3.10.40 transfer mode example: specifying the termination of transmis sion for (when using an external clock) stest1: bit 2, (sbi0sr) ; if = 1 then loop jr nz, stest1 stest2: bit 0, (pn) ; if sck0 = 0 then loop jr z, stest2 ld (sbi0cr1), 00000111b ; 0
tmp92cd54i 2009-12-26 92cd54i-191 tentative bit 7 sck0 pin so0 pin bit 6 t sodh = min. 3.5/f c [s] figure 3.10.41 transmitted data hold time at end of transmission b. 8-bit receive mode after specifying receive mode in the control register, write a 1 to sbi0cr1 to enable reception. in synchronization with the serial clock, data from the si0 pin is captured into the shift register in an lsb-first manner. once 8-bit data has been captured, the received data is moved from the shift register to sbi0dbr, thus causing an intsbe0 interrupt (buffer full) to occur that requests reading the received data. the interrupt handling routine should read the received data from sbi0dbr. in internal clock operation, the automatic wait function stops the serial clock until the received data is read from sbi0dbr. in external clock operation, read the received data before a next serial clock is input because shift operation is synchronized with an externally supplied clock. if the received data is not read, subsequently input received data will be cancelled. the maximum transfer rate with an external clock is determined from the maximum delay between an interrupt request being issued and the received data being read. to terminate reception, either set sbi0cr 1 to 0 or sbi0cr1 to 1 in the intsbe0 interrupt handling routine. if sbi0cr1 is cleared, reception is terminated once all bits of the data have been received and written to sbi0dbr. the program can determine the termination of re ception using sbi0sr . is cleared to 0 upon the termination of recept ion. after determining that reception has been terminated, read the last received data. setting sbi0cr1 to 1 causes reception to be aborted immediately and sbi0sr to be cleared to 0 (the received data becomes invalid and need not be read). note: when the transfer mode is switched, the contents of sbi0dbr are not maintained. if it is necessary to switch the transfer mode, first write a 0 to to terminate transfer and read the last received data.
tmp92cd54i 2009-12-26 92cd54i-192 tentative sbi0dbr intsbe0 interrupt request sck0 pin (output) si0 pin b clear a a 0 a 1 a 2 a 3 a 4 a 5 a 6 a 7 b 0 b 1 b 2 b 3 b 4 b 5 b 6 b 7 read receiver data read receiver data figure 3.10.42 receiver mode (example: internal clock) c. 8-bit transmit/receive mode after specifying transmit/receive mode in the control register, write transmit data to sbi0dbr. then, setting sbi0cr1 to 1 enables transmission and reception. the transmit data is output through the so0 pi n on the rising edge of the serial clock, in an lsb-first manner, while the received data is captured from the si0 pin on the falling edge of the clock. once 8-bit data has been captured, the received data is moved from the shift register to sbi0dbr, thus causing an intsbe0 interrupt request to be issued. the interrupt handling routine reads the received data from the data buffer register and then writes transmit data. ensu re that the received data is read before transmit data is written to sbi0dbr because sbi0dbr is shared for transmission and reception. in internal clock operation, automatic wait is performed between the received data being read and next transmit data being written. in external clock operation, it is necessary to read the received data and then write next transmit data before next shift operation starts because shift operation is synchronized with an externally supplied serial clock. the maximum transfer rate with an external clock is determined fr om the maximum delay between an interrupt request being issued and the received data being read, followed by transmit data being written. at the beginning of transmission, the same value as the last bit of the data transmitted last is output between sbi0sr being set to 1 and the falling edge of sck0. to terminate transmission/reception, either set sbi0cr1 to 0 or sbi0cr1 to 1 in the intsbe0 interrupt handling routine. if sbi0cr1 is cleared, transmission/reception is terminated once all bits of the data have been received and written to sbi0dbr. the program can determine the termination of transmission/reception us ing sbi0sr . sbi0sr is cleared to 0 upon the termination of transmission/reception. setting sbi0cr1 to 1 causes transmission/reception to be aborted immediately and sbi0sr to be cleared to 0. note: when the transfer mode is switched, the contents of sbi0dbr are not maintained. if it is necessary to switch the transfer mode, first write a 0 to to terminate transfer and read the last received data.
tmp92cd54i 2009-12-26 92cd54i-193 tentative sbi0dbr intsbe0 interrupt request sck0 pin (output) so0 pin si0 pin clear c 0 c 1 c 2 c 3 c 4 c 5 c 6 c 7 d 0 d 1 d 2 d 3 d 4 d 5 d 6 d 7 write transmitted data (a) read received data (d) a 0 a 1 a 2 a 3 a 4 a 5 a 6 a 7 b 0 b 1 b 2 b 3 b 4 b 5 b 6 b 7 * d b c a read received data (c) write transmitted data (b) figure 3.10.43 transmit/received mode (example : internal clock) bit 7 in last transmitted word sck0 pin so0 pin bit 6 t sodh = min. 4/f c [s] figure 3.10.44 transmitted data hold time at end of transmit/receive
tmp92cd54i 2009-12-26 92cd54i-194 tentative 3.11 serial expansion interface (sei) 3.11.1 overview the serial expansion interface (sei) is one of the interfaces built into the tmp92cd54i and can connect to peripheral devices usin g a full-duplex synchronous communication protocol. it also supports micro dma mode, in which it transfers data using micro dma. the tmp92cd54i contains a single sei channel (sei0). (1) features ? the master outputs a shift clock only when data is being transferred. ? the clock polarity and phase are programmable. ? the data length is eight bits. ? msb- or lsb-first transfer can be selected. ? supports transfer using mi cro dma (micro dma mode). ? the master can select one of the following three transfer rates: 4 mbps, 2 mbps, and 500 kbps (when fc = 20 mhz) ? the error detection circuit supports the following functions: a. write collision detection: if the shift register is written during a transfer. b. overflow detection: if new data is rece ived when the transfer completion flag is set to 1 (slave mode only). c. mode fault detection: if the input to the ss pin is driven low in master mode (driver output turned off immediately). figure 3.11.1 sei block diagram sei control unit port control unit shift register read buffer clock control unit sei data registe r clock selector bit order mux sei control register sei status register miso internal sei clock d<7:0> see mode mstr cph a cpol bos ser1:0 tmse tasm sef tsrc tstc modf wcol sovf mosi seclk ss a<1:0> seics clock divider 2 4 16 intsem intsee intser intset
tmp92cd54i 2009-12-26 92cd54i-195 tentative table 3.11.1 pin function of sei channels sei ss (pm0) mosi (pm1) miso (pm2) seclk (pm3) 3.11.2 sei operation during an sei transfer, data transmission (serial shift-out) and reception (serial shift-in) are performed simultaneously. the sei clock (seclk) provides synchronization for shifting and sampling information on the two serial data lines (mosi and miso). the slave select line ( ss ) selects an individual slave device. only the selected slave device can do the sei transfer using the sei bus. (1) controlling the sei clock phase and polarity four types of sei clock can be selected by two bits in the sei control register (secr) that control the phase and polarity of the clock. the clock polarity is controlled with the bit, which selects either an active-high or active-low clock. the clock phase is controlled with the bit, which selects one of two different transfer formats. the clock phase and polarity must be the same between the master device and the slave device it communicates with. (2) sei data and clock timing the sei has programmable clock timing and data, which support most synchronous serial peripheral devi ces. see ?3.11.4 sei transfer format.?
tmp92cd54i 2009-12-26 92cd54i-196 tentative 3.11.3 sei pin functions the sei has four input and output pins for data transfer. the function of each pin depends on the sei device mode (master or slave). (1) seclk pin the seclk pin functions as an output when the sei is set to master mode or as an input when the sei is set to slave mode. when the sei is a master, the seclk signal is supplied from its internal sei clock generator. once the master has started a transfer, eight clock cycles are automatically supplied on the seclk pin. when the sei is a slave, the seclk pin functions as an input and the seclk signal supplied from the master synchronizes data transfer between the master and slave. if the slave select pin, ss , is driven high, the slave device ignores the seclk signal. both the master and slave devices shift data on the rising or falling edge of the seclk signal and sample data on the opposi te edge. the edge polarity depends on the sei transfer protocol. (2) miso and mosi pins the miso and mosi pins are used to transmit and receive serial data. when the sei is set to a master, the miso turns into the input signal and the mosi turns into the output signal. when the sei is set to a slave, the functions of the pins are reversed. in sei system, all seclk pins are interconnected, all mosi pins are interconnected, and all miso pins are interco nnected. see figure 3.11.5. a single sei device is set as a master while all other se i devices on the sei bu s are set to slaves. the master device transmits the transfer clock and data from its seclk and mosi pins to the seclk and mosi pins of slave devices, respec tively. the single selected slave device transmits data from its miso pin to the master device's miso pin. the seclk, miso, and mosi pins can also be programmatically set to open-drain, using the corresponding bits in the port m open-drain enable register, pmode. (3) ss pin the ss pin functions differently depending on whether the sei is set to a master or slave. a slave device uses the pin to enable sei slave transmission/reception. if its ss pin is high (not active), the slave device ignores the seclk clock and places its miso output pin in high-impedance state. a master device uses the ss pin to detect an sei error. if its ss pin is driven low when the sei is a master, it indicates that another device on the sei bus is attempting to become a master. the master device thus detects an error and immediately releases the sei bus to prevent damage from a driver collision. such an error is called a mode fault. the bit in the secr register enables or disables detection for a mode fault. when the bit is set to 0, the ss pin is enabled as a mode fault detection input. when the bit is set to 1, mode fault detection using the ss pin is disabled.
tmp92cd54i 2009-12-26 92cd54i-197 tentative 3.11.4 sei transfer format the transfer format is determined by the and bit settings in the secr register. the bit selects one of two different transfer protocols. (1) transfer format when = 0 figure 3.11.2 shows the transfer format when = 0. seclk cycle 1 2 3 4 5 6 7 8 seclk(=0) seclk(=1) internal shift clock mosi miso ss (compatibility mode) (micro dma mode) (micro dma mode & master) (micro dma mode & slave) figure 3.11.2 transfer format when = 0 table 3.11.2 data timing when = 0 =0 no communication (idle) seclk level data shift data sampling =0 l shift clock falling edge shift clock rising edge =1 h shift clock rising edge shift clock falling edge in master mode, writing new data to the sedr register causes a data transfer to start. data on the mosi pin is switched a half clock cycle before the shift clock starts operating. the secr bit specifies whether data will be shifted out in msb- or lsb-first manner. after the last shift cycle, the sesr flag is set to 1 in compatibility mode or the and sesr flags are set to 1 in micro dma mode. in slave mode, a write to the sedr register is prohibited while the ss pin is low. writing data during that period results in a write collision, causing the flag in the sesr register to be set to 1. therefore, if the sesr or sesr flag is set to 1 upon the completion of data transfer, the program must wait until the ss pin is driven back high before attempting to write next da ta to the sedr register. in slave mode, if micro dma is used to transfer data to the se dr register, the sesr flag is not set until the ss pin is driven high.
tmp92cd54i 2009-12-26 92cd54i-198 tentative (2) transfer format when = 1 figure 3.11.3 shows the transfer format when = 1. seclk cycle 1 2 3 4 5 6 7 8 seclk(=0) seclk(=1) mosi miso ss (compatibility mode) (micro dma mode) (micro dma mode) figure 3.11.3 transfer format when = 1 table 3.11.3 data timing when = 1 =1 no communication (idle) seclk level data shift data sampling =0 l shift clock rising edge shift clock falling edge =1 h shift clock falling edge shift clock rising edge in master mode, writing new data to the sedr register causes a data transfer to start. the data on the mosi pin is switched on the first edge of the shift clock. the secr bit specifies whether data will be shifted out in msb- or lsb-first manner. in slave mode, unlike the format used when secr = 0, a write to the sedr register is allowed even when the ss pin is low. in both master and slave modes, after the last shift cycle, the sesr flag is set to 1 in compatibility mode or the sesr and sesr flags are simultaneo usly set to 1 in micro dma mode. writing to the sedr register during a data transfer results in a write collision. do not write data to sedr before the sesr flag or the sesr and flags are set to 1.
tmp92cd54i 2009-12-26 92cd54i-199 tentative 3.11.5 functional description figure 3.11.4 shows connection betw een master and slave on sei system. when the master device transmits data from it s mosi pin to the slave device's mosi pin, the slave device transmits data from its miso pin to the master device's miso pin. it indicates that data output and input are synchronized using the same clock signal in full-duplex communication. upon the completion of transfer, the transmit data in the 8-bit shift register is replaced with the received data. master slave 8-bit shift register 8-bit shift register sei clock generator 5v 0v figure 3.11.4 connection between master and slave in sei figure 3.11.5 shows an exampl e sei system configuration. sei output ports can be programmatically set to open-drain output. multiple devices can thus be connected. master slave 0 slave 1 portn portn? ss seclk mosi miso ss seclk mosi miso ss seclk mosi miso portn, n?: any output ports figure 3.11.5 configuration of sei system (comprised of one master and two slaves) mosi mosi ss ss miso miso seclk seclk vcc
tmp92cd54i 2009-12-26 92cd54i-200 tentative 3.11.6 operating modes the sei supports two different operating modes, compatibility mode and micro dma mode, and operates in the selected mode. these modes differ in how a flag is cleared and an interrupt is generated as well as whether micro dma can be used. table 3.11.4 differences between the two operation modes compatibility mode micro dma mode error flag clearing reading a register with the status flag set, followed by secr register or reading or writing sedr register writing a ?1? to the status register transfer status flag clearing reading a register with the status flag set, followed by an reading or writing to the data register writing a ?1? to the status register or by reading or writing the data register interrupt generation intsem: intsee: intsem: intsee: or intser: intset: micro dma usage no yes the sei operating mode can be switched using sesr when the sei is disabled (secr = 0).
tmp92cd54i 2009-12-26 92cd54i-201 tentative 3.11.7 sei registers the sei can be configured using the sei cont rol register (secr), sei status register (sesr), and sei data register (sedr). note: when reading sei registers (secr, sesr, and sedr) after writing to them, there must be an interval of at least four states bet ween the write and read. the program should take that interval into account. programming example: ld (sedr), data1 ; write to sedr nop ; nop ; nop or other instruction not reading sei register ld a,(sesr) ; read from sesr ld (sesr), data2 ; write to sedr nop ; nop ; nop or other instruction not reading sei register ld a,(sesr) ; read from sesr (1) sei control register (secr) sei control register 7 6 5 4 3 2 1 0 secr bit symbol mode see bos mstr cpol cpha ser1 ser0 (0060h) read/write w r/w after reset 0 0 0 0 0 1 1 1 read- modify- write not allowed function mode fault detection 0:enabled 1:disabled sei operation 0:stopped 1: operating bit order selection 0:msb first 1:lsb first mode selection 0:slave 1:master clock polarity selection see figure 3.11.2, 3.11.3 clock phase selection see figure 3.11.2, 3.11.3 sei transfer rate selection 00: reserved 01: divide-by- 2 10: divide-by- 4 11: divide-by-16 figure 3.11.6 sei registers (secr) : mode fault detection enable 0: enables mode fault detection. 1: disables mode fault detection. this bit is valid only in master mode and invalid in slave mode. : sei function enable 0: disables the sei function. to switch betwe en micro dma mode and compatibility mode, first disable the sei function. ensure that data transfer has been completed before attempting to disable the sei function. also, when using the halt instruction to enter idle1, idle3, or stop mode, first disable the sei function. 1: enables the sei function. to use the sei, first set the relevant ports to sei pins. : bit order selection the bit selects whether data will be tran smitted in msb-first or lsb-first manner. 0: transmits the msb (bit 7) of the sedr register first. 1: transmits the lsb (bit 0) of the sedr register first. : master/slave mode selection 0: sets the sei to slave. 1: sets the sei to master.
tmp92cd54i 2009-12-26 92cd54i-202 tentative : clock polarity selection 0: selects an active-high clock. the seclk clo ck is low when communication is not performed. 1: selects an active-low clock. the seclk clock is high when communication is not performed. see figure 3.11.2 and figure 3.11.3. : clock phase selection the bit selects one of two different transfer formats. see figure 3.11.2 and figure 3.11.3. : sei bit rate selection the following table shows the relationship between the transfer bit rate and the settings of the and bits when the sei operates as the master. when the sei operates as a slave, the serial clock is supplied from the ma ster and the settings of the and bits are ignored. table 3.11.5 sei transfer bit rate divide-by-rate of internal sei clock transfer rate (@ fc = 20 mhz) 0 0 don?t use this setting. 0 1 4 4 mbps 1 0 8 2 mbps 1 1 32 500 kbps note: internal sei clock = 2/5 fc (2) sei status register (sesr) sei status register (compatibility mode) 7 6 5 4 3 2 1 0 sesr bit symbol sef wcol sovf modf - - - tmse (0061h) read/write r r/w after reset 0 0 0 0 - - - 0 compati- bility mode function sei transfer complete flag 1:transfer completed write collision flag 1:write collided overflow flag (slave) 1:overflow occurred mode fault flag (master) 1:fault occurred sei mode select 0:compati- bility mode 1:micro dma mode sei status register (micro dma mode) 7 6 5 4 3 2 1 0 sesr bit symbol - wcol sovf modf tsrc tstc tasm tmse (0061h) read/write r/c (note) r/w after reset - 0 0 0 0 0 0 0 micro dma mode read- modify- write not allowed function write collision flag 1:write collided overflow flag (slave) 1:overflow occurred mode fault flag (master) 1:fault occurred sei receive complete flag 1:receive completed sei transmit complete flag 1:transmit completed sei automated shift mode (master) interrupt mask (slave) sei mode select 0:compati- bility mode 1:micro dma mode note: r/c indicates that read access and clear (by writing a 1) from the cpu are allowed. figure 3.11.7 sei registers (sesr)
tmp92cd54i 2009-12-26 92cd54i-203 tentative : transfer completion flag compatibility mode: the flag is automatically set to 1 upon t he completion of data transfer. when the flag is set to 1, reading the sesr register and read ing or writing to the sedr register causes the flag to be automatically cleared to 0. micro dma mode: the flag value is undefined when read. a write to the flag is invalid. : write collision error flag compatibility mode: the flag is automatically set to 1 when t he sedr register is written during data transfer. a write to the sedr register is invalid during data transfer. when the flag is set to 1, reading the sesr register and reading or writing to the sedr register causes the flag to be automatically cleared to 0. no inte rrupt occurs when the flag is set. micro dma mode: the flag is automatically set to 1 when t he sedr register is written during data transfer. a write to the sedr register is invalid during dat a transfer. the flag is cleared to 0 only by writing a 1 to the bit. a write of 0 is invalid. if the flag changes its state from 0 to 1 when the bit is 0 in slave m ode, an intsee interrupt pulse is generated. : overflow error flag master mode: the flag value is undefined when read. a write to the flag is invalid. slave mode: compatibility mode: the flag is automatically set to 1 upon the completion of receiving next data when the flag is set to 1. when the flag is set to 1, reading the sesr register and reading or writing to the sedr register causes the flag to be automatically cleared to 0. the flag is also cleared when the oper ating mode is switched to master mode. in compatibility mode, no interrupt occurs when the flag is set. micro dma mode: the flag is automatically set to 1 upon the completion of receiving next data when the flag is set to 1. the flag is clea red to 0 only by writing a 1 to the bit. a write of 0 is invalid. if the flag changes its state from 0 to 1 when the bit is 0, an intsee interrupt pulse is generated. : mode fault error flag master mode: compatibility mode: the flag is set to 1 when the ss pin is driven low. at that time, the sei operates as follows: 1. disable the sei output pin driver, thus pl acing the output pin in high-impedance state. 2. clear the bit in the secr register to 0. 3. forcibly clear the bit in the secr register to 0, thus disabling the sei system. 4. generate an intsem interrupt pulse. when the flag is set to 1, reading the sesr register and writing to the sedr register causes the flag to be automatically cleared to 0. micro dma mode: operation is the same as that in compatibility mode, except how the flag is cleared. the flag is cleared to 0 only by writing a 1 to the bit. a write of 0 is invalid. slave mode: the flag value is undefined when read. a write to the flag is invalid. : receive completion flag compatibility mode: the flag value is undefined when read. a write to the flag is invalid. micro dma mode: once eight clock cycles have been shifted onto the seclk pin, reception is completed and the flag is set to 1. the flag is cl eared to 0 by reading the sedr register, switching
tmp92cd54i 2009-12-26 92cd54i-204 tentative to compatibility mode, or writing a 1 to the bit. a write of 0 to this flag is invalid. an intser interrupt pulse is generated when the flag is set. : transmit completion flag compatibility mode: the flag value is undefined when read. a write to the flag is invalid. micro dma mode: the flag is set upon the completion of transmitting a single byte of data, but the timing is different depending on the transfer format and whether the device is a master or slave. see figure 3.11.2 and figure 3.11.3. the flag is cleared to 0 by writing to the sedr register, switching to compatibility mode, or writing a 1 to the bit. a write of 0 to this flag is invalid. an intset interrupt pulse is generated when the flag is set. : automatic shift mode (maste r) / intsee interrupt mask (slave) automatic shift mode makes micro dma transfer co operate with the sei transfer. the function of this bit depends on the bit setting. compatibility mode: the flag value is undefined when read. a write to the flag is invalid. micro dma mode: master mode: 0: disables automatic shift mode. 1: enables automatic shift mode. in this mode, reading from the sedr re gister causes the following operation: - clear the sedr register to 00h. - start next data transfer; transmit 00h and receive new 8-bit data. by assigning intser interrupt as the startup of micro dma, master device can receive the data block. when the sei operates in slave mode, automatic shift mode is invalid. slave mode: the bit functions as a mask for generating an intsee interrupt with the and flags. 0: generates an intsee interrupt pulse when the flag is set. 1: generates an intsee interrupt pulse when the flag is set. : mode selection 0: selects compatibility mode. 1: selects micro dma mode. in dma mode, micro dma transfer is allowed. ensu re that the sei function is disabled before attempting to change the mode.
tmp92cd54i 2009-12-26 92cd54i-205 tentative (3) sei data register (sedr) sei data register (for reception) sedr 7 6 5 4 3 2 1 0 (0062h) bit symbol sed7 sed6 sed5 sed4 sed3 sed2 sed1 sed0 read/write r read- modify- write not allowed after reset 0 0 0 0 0 0 0 0 sei data register (for transmission) sedr 7 6 5 4 3 2 1 0 (0062h) bit symbol sed7 sed6 sed5 sed4 sed3 sed2 sed1 sed0 read/write w read- modify- write not allowed after reset 0 0 0 0 0 0 0 0 figure 3.11.8 sei registers (sedr) the sei data register (sedr) is used fo r data transmission and reception. when the sei is set to a master, writing data to the sedr register starts data transfer. once a transfer has been started, the master device must use an interrupt or polling to ensure that the transfer completion flag is set to 1 before attempting to write new data to the sedr register. the sedr register can be read or written only if the bit in the secr register is set to 1. if the secr bit is set to 0, a write to the sedr register is ignored and reading the register always returns a value of 00h.
tmp92cd54i 2009-12-26 92cd54i-206 tentative 3.11.8 sei system errors the sei device detects three types of system errors. the first type of error occurs if the input to the ss pin on the master device is driven low. this error is called a mode fault. the second type of error, a write collision, o ccurs if data is written to the sedr register during data transfer. the third type of error, an overflow error, occurs if a new data byte has been shifted in before the previous data byte has been read when the sei device is operating as a slave. (1) mode fault error if more than one sei device is set to a master, contention among drivers may occur. when an sei device is set to a master, if its ss pin input is driven low, a mode fault error occurs and the device turns off its driver output. this function prevents contention among masters. if this error occurs, the device imme diately takes the following actions: ? forcibly clear the bit in the secr register to 0, thus re-setting the sei to a slave. ? forcibly clear the bit in the secr register to 0, thus disabling the sei function. ? set the flag in the sesr regist er to 1, which generates an intsem interrupt pulse. ? disable the sei output pin driver, thus placing the output pin in high-impedance state. once the sesr flag is cleared to 0 after the software has resolved the problem causing a mode fault, the sei device can accept setup for recovering normal operation. the secr register cannot be written if the sesr flag is set to 1. in compatibility mode, when the sesr flag is set to 1, reading the sesr register and writing to the sedr register causes the sesr flag to be cleared to 0. in micro dma mode, write a 1 to the sesr flag to clear it. a mode fault error is detected only if more than one device is simultaneously selected as a master. the se i device cannot detect a collision between miso pins when more than one slave device is selected on the sei system. an open-drain option is provided to protect the device from latch-up. this option changes the sei output driver to an open-drain driver. each of the seclk, mosi, and miso pins can be individually set to open-drain programmatically. in that case, an external pull-up resistor needs to be added. (2) write collision error a write collision occurs if the sedr register is written while data is being transferred. the sedr register does not have a double-buffer configuration in the direction of transmission so th at data written to the sedr register before transfer is written directly to the sei shift register. a write during a data transfer thus fails and results in a write collision error. in this case, the on-going data transfer is completed but the written data causing a write collision error is not written to the shift register. ? in slave mode the sedr register is written while the ss pin is driven low. ( = 0) the sedr register is written while data is being transferred. ( = 1) ? in master mode the sedr register is written while data is being transferred.
tmp92cd54i 2009-12-26 92cd54i-207 tentative a write collision is usually an error on the slave side because a slave cannot control when the master starts a data transfer. the master, which knows when it transfers data, does not cause a write collision error although both master and slave sei devices can detect a write collision error. in slave mode, a write collision occurs if the master has already started a shift cycle for a next byte before the slave transf ers a new data to the sedr register. in slave and micro dma mode, if the sesr flag is set when the sesr bit is 0, an intsee interrupt pulse is generated. (3) overflow error the transfer bit rate on the sei bus is determined by the master. at a high bit rate, the slave may fail to keep up with transfer from the master. overflow occurs when the following two conditions are satisfied: ? the sei device is set to a slave. ? a new data has been received but the previous data has not yet been read. the sei device can detect a data overflow using the sesr flag. when the sesr flag is set to 1, the sedr register is overwritten with the new data byte. in slave mode, if the sesr flag is set when the sesr bit is 1, an intsee interrupt pulse is generated in mi cro dma mode only. the sesr bit is used as an interrupt mask bit becaus e this error occurs in slave mode only.
tmp92cd54i 2009-12-26 92cd54i-208 tentative 3.11.9 generating an interrupt interrupt handling differs between two sei operating modes and can be selected using the sesr bit. the sei generates fo ur types of interrupts: intsem, intsee, intser, and intset. (1) compatibility mode in compatibility mode, the sei generates two types of interrupts, intsem and, intsee. an intsem interrupt pulse is generated if the sesr flag changes its state from 0 to 1. an intsee interrupt pulse is generated if the sesr flag changes its state from 0 to 1. table 3.11.6 compatibility mode intsem interrupt on intsee interrupt on intser inactive intset inactive (2) micro dma mode in micro dma mode, all of four interrupt types are used to enable micro dma transfer with the sedr register. an intsem interrupt pulse is generated if the sesr flag changes its state from 0 to 1. an intsee interrupt is generated if, in slave mode, the sesr flag changes its state from 0 to 1 when the sesr bit is set to 0. it is also genera ted if, in slave mode, the sesr flag changes its state from 0 to 1 when the sesr bit is set to 1. upon the completion of transfer, both the sesr and flags are set to 1 simultaneously, except when secr is set to 0 in slave mode. see "3.11.4(1) format when = 0." thos e flags trigger the generation of intser and intset interrupt pulses, respectively. an intser interrupt pulse is generated if the sesr flag changes its state from 0 to 1. the sesr flag is cleared to 0 by reading the sedr register or writing a 1 to the sesr bit. an intset interrupt pulse is generated if the sesr flag changes its state from 0 to 1. the sesr flag is cleared to 0 by writing to the sedr register or writing a 1 to the sesr bit. when using micro dma transfer to and from the sedr register, use intser and intset interrupts as triggers for micro dma transfer. intser interrupt: use as a trigger to read the sedr register. intset interrupt: use as a trigger to write to the sedr register. next data transfer is started that way. table 3.11.7 compatibility mode intsem interrupt on intsee interrupt on 1) or 2) intser interrupt on intset interrupt on note 1: when sesr = 0 in slave mode note 2: when sesr = 1 in slave mode each interrupt handling should be enabled or disabled using the interrupt controller. (see 3.4.3.)
tmp92cd54i 2009-12-26 92cd54i-209 tentative 3.11.10 using micro dma with the sei (micro dma mode) micro dma improves the sei transfer speed by: ? taking the load off the cpu for interrupt handling, and ? reducing the time interval between transfers. micro dma transfer is used in both master and slave modes. (1) micro dma transfer (read/write) in this mode, set the bit in the sesr register to 1 to select micro dma mode. two micro dma channels are used. one channel is used to transfer received data from the sedr register to a specified ram area while the other channel is used to transfer transmit data from a specified ram area to the sedr register. data transfer is completely under the control of the micro dma controller. a. initialization two micro dma channels are used for sei transfer. one micro dma channel is set to be activated with an intser interrupt pulse and transfer received data from the sedr register to memory. the other channel is set to be activated with an intset interrupt pulse and transfer new data from memory to the sedr register. in master mode, data transfer is restarted with those initial settings. set the micro dma channel having the smaller channel number to an intser interrupt. this ensures that received data is read before a write to the sedr register to start new data transfer. in master mode, writing to the sedr register starts the first data transfer. in slave mode, write data to the sedr register as a preparation for transfer started from the connected master. subsequent transfers are automatically performed by the micro dma controller. table 3.11.8 sei setting when micro dma transfer (read/write) 0:slave intsee interrupt mask 1 1:master 0 1 b. micro dma transfer once initialized, micro dma waits for a data transfer completion trigger. upon the completion of transfer, the and flags are set to 1, thus causing an sei reception completion interrupt (intser) pulse and sei transmission completion in terrupt (intset) pulse to be generated. the micro dma channel having the smaller channel number is processed first. therefore, read processing with micro dma transfer caused by reception completion is performed before write processing with micro dma transfer caused by transmission completion. read processing with micro dma transfer consists of reading the sedr register and writing to the address specified with the micro dma transfer destination a ddress register. in addition , read the sedr register and clear the flag to 0. then, for write processing with micro dma transfer, read the address specified with the micro dma transfer source address register and write to the sedr register. in addition, read the sedr register and clear the flag to 0. if the sei is the master, start a new data transfer.
tmp92cd54i 2009-12-26 92cd54i-210 tentative after each micro dma transfer, decrement the transfer count register for both micro dma transfers. the above procedure continues until the transfer count register becomes 0. once the transfer count register becomes 0, a micro dma transfer completion interrupt occurs. the service routine for a micro dma transfer completion interrupt is used to reinitialize micro dma transfer
tmp92cd54i 2009-12-26 92cd54i-211 tentative figure 3.11.9 flowchart for micro dma read/write transfer setup lower micro dma register for automated read, triggered on intser initiation sei for micro dma mode refer to table 3.11.4 setup higher micro dma register for automated read, triggered on intser if sei is setup as a master, start the first write transfer by writing the first value to the sedr register. write data in the sedr register before transfer when sei is slave mode. register initial setting wait on transfer completed ,=1 generates intser,intset read micro dma transfer (since the read micro dma owns the lower channel number the read micro dma is processed first.) micro dma is written at the address which reads sedr register and was set up by transmission destination address register. the read-access to the sedr register automatically clears the flag to 0. write micro dma transfer decrease micro dma counter micro dma reads the address set to by transmitting agency address register, and writes it to sedr register. according to a setup of transmission mode register, transmission destination address register serves as address increment, decrement, or fixation. decrease micro dma counter the write-access to the sedr register automatically clears the flag to 0. generate micro dma transfer end interrupts for both channels no yes end according to a setup of transmission mode register, transmission destination address register serves as address increment, decrement, or fixation. micro dma counter = 0? initiation transfer beginning
tmp92cd54i 2009-12-26 92cd54i-212 tentative (2) micro dma transfer (read only) this mode is used to receive a data block (for example, to read data from serial e 2 prom). meaningless data is transmitte d simultaneously. a single micro dma channel is used to read received data from the sedr register and store it in a specified ram area. a. initialization in this mode, set the bit in the sesr register to 1 to select micro dma mode. the sesr bit is used as an automatic shift enable bit while the sei is operating as a master. one micro dma channel is set to be activated with an intser interrupt pulse and transfer received data from the sedr register to memory. an intser interrupt activates micro dma transfer. an intset interrupt must be disabled using the interrupt controller. when the sei is a master, writing data to the sedr register starts the first data transfer. (when the sei is a slave, it waits until it receives data transmitted from the master.) table 3.11.9 sei setting when micro dma transfer (read) 0: slave intsee interrupt mask 1 1: master 1 1 b. micro dma transfer after starting the first data transfer, micro dma waits until the data transfer is completed. upon the completion of data transfer, both and flags in the sesr register are set to 1. an intser interrupt pulse caused by the sesr flag being se t activates micro dma transfer. the sesr flag is also set to 1 simultaneously and remains set until the block transfer is completed. micro dma reads the received data from the sedr register and writes it to the memory address specified with the mi cro dma transfer destination address register. after each data transfer, the micro dma transfer count register is decremented. reading the sedr register ca uses it to be automatically cleared to 00h because the sesr bit is set to 1. at that time, a new data transfer starts automatically. the above processing continues until the micro dma transfer count register becomes 0. once the transfer count register becomes 0, a micro dma transfer completion interrupt occurs. after the first data transfer is complete d, the sesr flag remains set to 1 unless it is explicitly cleared.
tmp92cd54i 2009-12-26 92cd54i-213 tentative figure 3.11.10 flowchart for micro dma read only transfer if sei is setup as a master, start the first write transfer by writing the first value to the sedr register. set sei to micro dma mode. set it to the automatic shift mode (=1) when sei is a master. refer to table 3.11.5 =1 generates intser register initial setting setup micro dma channel for automated read, triggered on intser. transfer beginning wait on transfer completed read micro dma transfer micro dma is written at the address which reads sedr register and was set up by read transmission destination address register. according to a setup of transmission mode register, transmission destination address register serves as address increment, decrement, or fixation. decrease micro dma counter the read-access to the sedr register automatically clears flag to 0. when =1 1, clears sedr register (00h) 2, start a new transfer automatically 3, new 8 bits are shifted in generate micro dma transfer end interrupts no yes end initiation micro dma counter = 0?
tmp92cd54i 2009-12-26 92cd54i-214 tentative (3) micro dma transfer (write only) this mode is used to transmit a data block. received data is ignored. only a single micro dma channel is used to read data from the memory address specified with the micro dma transfer source address register and write new data to the sedr register. a. initialization in this mode, set the bit in the sesr register to 1 to select micro dma mode. one micro dma channel is set to tr ansfer transmit data from the memory address specified with the micro dma transfer source address register to the sedr register. an intset interrupt activates this micro dma transfer. an intser interrupt must be disabled using the interrupt controller. when the sei is a master, writing data to the sedr register starts the first transfer. (when the sei is a slave, it waits until it receives data transmitted from the master.) table 3.11.10 sei setting when micro dma transfer (write) 0: slave intsee interrupt mask 1 1: master 0 1 b. micro dma transfer after starting the first data transfer, micro dma waits until the data transfer is completed. upon the completion of data transfer, both and flags in the sesr register are set to 1. ignore the sesr and sesr flags because reception is not pe rformed. after the first transfer is completed, the sesr flag remains set to 1 unless it is explicitly cleared. the sesr flag, once set, also remains set to 1 unless it is explicitly cleared. an intset interrupt pulse caused by the sesr flag being set activates micro dma transfer. micro dma reads transmit data from the memory address specified with the micro dma transfer source a ddress register and writes it to the sedr register. a write to the sedr register causes the sesr flag to be cleared to 0 and, if the sei is the master, a new data transfer to start. after each data transfer, the micro dma transfer count register is decremented. the above processing continues until the micro dma transfer count register becomes 0. once the transfer count register becomes 0, a mi cro dma transfer completion interrupt occurs.
tmp92cd54i 2009-12-26 92cd54i-215 tentative figure 3.11.11 flowchart for micro dma write only transfer register initial setting if sei is setup as a master, start the first write transfer by writing the first value to the sedr register. set sei to micro dma mode. refer to table 3.11.6 =1 generates intset setup micro dma channel for automated read, triggered on intset. transfer beginning wait on transfer completed write micro dma transfer micro dma is written at the address set up by transmitting agency address register, and writes it to sedr register. according to a setup of transmission mode register, transmission destination address register serves as address increment, decrement, or fixation. decrease micro dma counter the write-access to the sedr register automatically clears flag to 0. generate micro dma transfer end interrupts no yes end initiation micro dma counter = 0?
tmp92cd54i 2009-12-26 92cd54i-216 tentative 3.12 can controller (1) overview ? complies with can version 2.0b. ? supports the standard and extended formats. ? supports data and remote frames in each format. ? 16 mailboxes (15 shared for transmission and reception, and 1 for reception only) ? can bus baud rate: up to 1 mbps (when operating frequency fc = 20 mhz) ? programmable baud rate using bit time parameters ? built-in baud rate prescaler ? two types of internal arbitration to se lect the order of me ssage transmission: a. ascending order of mailbox number b. descending order of id priority ? timestamp for message tr ansmission/reception ? operating modes a. normal operation mode b. configuration mode c. sleep mode (can wake up upon detection of can bus active state or upon cpu access) d. halt mode e. test loopback mode (stand-alone operation possible with self-acknowledge) f. test error mode (can write to error counter) ? two types of message reception masking a. programmable global reception mask (common to mailboxes 0 to 14) b. programmable local reception mask (dedicated to mailbox 15) ? reception mask bit for id extension bit ? flexible interrupt structure (three interrupt signals) a. intcr: reception completion interrupt b. intct: transmission completion interrupt c. intcg: global interrupt (with eight interrupt sources, including wa rning level, error pa ssive, and bus off) (2) legend ? r/w cpu read and write access allowed ? r only cpu read access allowed ? w only cpu write access allowed ? r/s cpu read access and setting (by writing a 1) allowed ? r/c cpu read access and cleari ng (by writing a 1) allowed ? for a mailbox, a dash ? ? in the bit symb ol field indicates an empty bit. its state is undefined when read. ? for a mailbox, a dash ? ? ? in the "upon reset" field indicates that the initial value is undefined. ? for a control register, a dash ? ? in th e bit symbol field indica tes a reserved bit. its state is undefined when read. when writing to the register, write a 0 to that bit.
tmp92cd54i 2009-12-26 92cd54i-217 tentative (3) architecture figure 3.12.1 block diagr am of can controller (4) can input/output pins the can controller uses rx and tx as its input and output pins, respectively. it should connect to the can bus through a can tran sceiver (complying with iso/dis 11898). can state machine mailbox 16128 bits cpu interface control register & interrupt logic can protocol controller transmit buffer data field identifier transmit multiplexor transmit data data address savedata receive data tx rx internal priority compare register control bus internal control adr data rd wr d a rd wr d a mailbox data out mailbox data in write decoder temporary receive buffer data field identifier match id rd wr a time stamp counter gam mask lam mask acceptance filter compare register write identifier (compare) intcr intct intcg
tmp92cd54i 2009-12-26 92cd54i-218 tentative 3.12.1 memory map the mailboxes and control registers used for can are mapped to the following areas: table 3.12.1 can mailboxes and control registers address register description 000200h * 000202h * : 0002feh * mb0mi0 mb0mi1 : mb15tsv mailbox 000300h mc mailbox configuration register 000302h md mailbox direction register 000304h * trs transmit request set register 000306h * trr transmit request reset register 000308h * ta transmission acknowledge register 00030ah * aa abort acknowledge register 00030ch * rmp receive message pending register 00030eh * rml receive message lost register 000310h lam0 (high) local acceptance mask register 0 (bit 28 to 16) 000312h lam1 (low) local acceptance mask register 1 (bit 15 to 0) 000314h gam0 (high) global acceptance mask register 0 (bit 28 to 16) 000316h gam1 (low) global acceptance mask register 1 (bit 15 to 0) 000318h mcr master control register 00031ah gsr global status register 00031ch bcr1 bit configuration register 1 00031eh bcr2 bit configuration register 2 000320h * gif global interrupt flag register 000322h gim global interrupt mask register 000324h * mbtif mailbox transmit interrupt flag register 000326h * mbrif mailbox receive interrupt flag register 000328h mbim mailbox interrupt mask register 00032ah cdr change data request register 00032ch * rfp remote frame pending register 00032eh * cec can error counter register 000330h tsp time stamp counter prescaler register 000332h * tsc time stamp counter register note: rmw prohibited: a read-modify-write operation should not be used.
tmp92cd54i 2009-12-26 92cd54i-219 tentative 3.12.2 mailboxes a mailbox consists of registers for storing an id and transmit/receive data and is accessed from the can controller or cpu. the cpu controls the can controller by modifying the contents of mailboxes and control registers. the contents of mailboxes and control registers are used for reception filt ering, message transm ission and interrupt handling. to start transmission, set the corresponding transmission request bit. subsequently, the can controller performs all transmission procedures and error handling, as required, without the intervention of the cpu. if a mailbox is set for reception, the cpu can use a read instruction to read data from the mailbox. a mailbox can also be set to issue an interrupt to the cpu every time a message ha s been transmitted or received successfully. there are 16 mailbox, each of which contains 8-byte data, a 29-bit id and several control bits. each mailbox can be set for either transmission or reception, except the last one. mailbox 15 is a receive-only mailbox that has been designed to receive a different group of message ids using a reception mask different from the one used for mailboxes 0 to 14. a single mailbox consists of 16 bytes. address mailboxes 0200h to 020fh mb0 (used for transmit/receive) 0210h to 021fh mb1 (used for transmit/receive) : : : : 02e0h to 02efh mb14 (used for transmit/receive) 02f0h to 02ffh mb15 (used for receive-only) figure 3.12.2 mailbox address each mailbox has the following structure: (mailbox ?n?) b15 b0 mbn + 00h mi0 (message identifier field 0) 02h mi1 (message identifier field 1) 04h mcf (message control field) 06h d1 d0 (data field 0,1) 08h d3 d2 (data field 2,3) 0ah d5 d4 (data field 4,5) 0ch d7 d6 (data field 6,7) 0eh tsv (time stamp value) note: mbn = 0200h + n 10h, n = 0, 1, 2, ?, 15 figure 3.12.3 mailbox structure the following describes the components of each mailbox.
tmp92cd54i 2009-12-26 92cd54i-220 tentative message id field 0 (mi0) message identifier field 0 low 7 6 5 4 3 2 1 0 mbnmi0l (mbn+00h) bit symbol id23 id22 id21 id20 id19 id18 id17 id16 read/write r/w after reset - - - - - - - - message identifier field 0 high 15 14 13 12 11 10 9 8 mbnmi0h (mbn+01h) bit symbol ide game rfh id28 id27 id26 id25 id24 read/write r/w after reset - - - - - - - - remote frame processing bit 0 for transmit mailbox, remote frame are not responded to. 1 for transmit mailbox, remote frame are responded to. (the bit is set.) 0/1 for receive mailbox, they are processed as data frames. (the and bits are set.) global (local) a cceptance mask enable 0 acceptance mask is not used for acceptance filtering. 1 acceptance mask is used fo r acceptance filtering. for mailbox 15, it functions as local acceptance mask enable bit . identifier extension bit 0 standard format (11-bit identifier) identifiers to are used. 1 extended format (29-bit identifier) identifiers to are used. note: if the received remote frame has the same id as that of a transmit mailbox for which =1 and =1, that mailbox is ov erwritten with the remote frame id and automatically responds with the overwritten id. figure 3.12.4 message id field 0 identifiers to are stored. identifiers to are stored. read- modify- write not allowed read- modify- write not allowed
tmp92cd54i 2009-12-26 92cd54i-221 tentative message id field 1 (mi1) message identifier field 1 low 7 6 5 4 3 2 1 0 mbnmi1l (mbn+02h) bit symbol id7 id6 id5 id4 id3 id2 id1 id0 read/write r/w after reset - - - - - - - - message identifier field 1 high 15 14 13 12 11 10 9 8 mbnmi1h (mbn+03h) bit symbol id15 id14 id13 id12 id11 id10 id9 id8 read/write r/w after reset - - - - - - - - note: for standard format (11-bit id), bits to are undefined. figure 3.12.5 message id field 1 a message id has a higher priority when it contains a longer sequence of zeros from the most significant bit (). mailbox ids should be registered as part of initialization. if the message id field for the mailbox needs to be modified after the mailbox has been enabled, first clear the mc bit to 0 to disable the mailbox for the can controller before writing a new id. identifiers to are stored. identifiers to are stored. read- modify- write not allowed read- modify- write not allowed
tmp92cd54i 2009-12-26 92cd54i-222 tentative message control field (mcf) the mcf register consists of the remote tran smission request bit (rtr) and data length code (dlc). a receive mailbox does not need initialization. when a received message is stored into the mailbox, rtr and dlc are also stored into the control field. a transmit mailbox needs initialization. if the control field for a transmit mailbox fo r which = 1 needs to be modified after the mailbox has been enabled, first clear the mc bit to 0 to disable the mailbox for the can controller before writing new rtr and dlc. the control field for a transmit mailbox for which = 0 can be modified regardless of the setting. it is, however, necessa ry to ensure that the trs bit is 0 before writing to new rtr and dlc. message control field low 7 6 5 4 3 2 1 0 mbnmcfl (mbn+04h) bit symbol rtr dlc3 dlc2 dlc1 dlc0 read/write r/w after reset - - - - - remote transmit request bit 0 data frame 1 remote fame data length code data bytes corresponding mailbox data 0000 0 byte none 0001 1 byte d0 0010 2 bytes d1, d0 0011 3 bytes d2, d0, d0 0100 4 bytes d3, d2, d1, d0 0101 5 bytes d4, d3, d2, d1, d0 0110 6 bytes d5, d4, d3, d2, d1, d0 0111 7 bytes d6, d5, d4, d3, d2, d1, d0 1000 8 bytes d7, d6, d5, d4, d3, d2, d1, d0 note: any data length code other than the above should not be used. message control field high 15 14 13 12 11 10 9 8 mbnmcfh (mbn+05h) bit symbol read/write after reset figure 3.12.6 message c ontrol field register read- modify- write not allowed read- modify- write not allowed
tmp92cd54i 2009-12-26 92cd54i-223 tentative data field (d0-d7) this read/write register contains up to eight bytes of data to be transmitted or received. for a receive mailbox, however, the data field should not be written. a write may result in received data being inconsistent. for transmission, a number of bytes specified with the dlc in the mailbox will be transmitted. for reception, the data length code in the re ceived message is copied to the dlc in the mailbox and only that number of data bytes are valid. to update the data field in a transmissi on mailbox for which = 1, first set cdr to 1 to suspend transmission requests before writing new data. to update the data field in a transmission mailbox for wh ich = 0, first ensure that trs bit is 0 before writing new data. data field 0 7 6 5 4 3 2 1 0 mbnd0 (mbn+06h) bit symbol d07 d06 d05 d04 d03 d02 d01 d00 read/write r/w after reset - - - - - - - - data field 1 15 14 13 12 11 10 9 8 mbnd1 (mbn+07h) bit symbol d17 d16 d15 d14 d13 d12 d11 d10 read/write r/w after reset - - - - - - - - data field 2 7 6 5 4 3 2 1 0 mbnd2 (mbn+08h) bit symbol d27 d26 d25 d24 d23 d22 d21 d20 read/write r/w after reset - - - - - - - - data field 3 15 14 13 12 11 10 9 8 mbnd3 (mbn+09h) bit symbol d37 d36 d35 d34 d33 d32 d31 d30 read/write r/w after reset - - - - - - - - data field 4 7 6 5 4 3 2 1 0 mbnd4 (mbn+0ah) bit symbol d47 d46 d45 d44 d43 d42 d41 d40 read/write r/w after reset - - - - - - - - data field 5 15 14 13 12 11 10 9 8 mbnd5 (mbn+0bh) bit symbol d57 d56 d55 d54 d53 d52 d51 d50 read/write r/w after reset - - - - - - - - read- modify- write not allowed read- modify- write not allowed read- modify- write not allowed read- modify- write not allowed read- modify- write not allowed read- modify- write not allowed
tmp92cd54i 2009-12-26 92cd54i-224 tentative data field 6 7 6 5 4 3 2 1 0 mbnd6 (mbn+0ch) bit symbol d67 d66 d65 d64 d63 d62 d61 d60 read/write r/w after reset - - - - - - - - data field 7 15 14 13 12 11 10 9 8 mbnd7 (mbn+0dh) bit symbol d77 d76 d75 d74 d73 d72 d71 d70 read/write r/w after reset - - - - - - - - figure 3.12.7 data field register timestamp value (tsv) this 16-bit register is loaded with the value of the timestamp counter when data has been transmitted or received successfully. it is not loaded if transmission or reception fails. time stamp value low 7 6 5 4 3 2 1 0 mbntsvl (mbn+0eh) bit symbol tsv7 tsv6 tsv5 tsv4 tsv3 tsv2 tsv1 tsv0 read/write r after reset - - - - - - - - time stamp value high 15 14 13 12 11 10 9 8 mbntsvh (mbn+0fh) bit symbol tsv15 tsv14 tsv13 tsv12 tsv11 tsv10 tsv9 tsv8 read/write r after reset - - - - - - - - figure 3.12.8 timestamp value register read- modify- write not allowed read- modify- write not allowed
tmp92cd54i 2009-12-26 92cd54i-225 tentative 3.12.3 control registers (1) mailbox control registers mailbox configuration register (mc) mailbox configurat ion register low 7 6 5 4 3 2 1 0 mcl (0300h) bit symbol mc7 mc6 mc5 mc4 mc3 mc2 mc1 mc0 read/write r/w after reset 0 0 0 0 0 0 0 0 mailbox configurat ion register high 15 14 13 12 11 10 9 8 mch (0301h) bit symbol mc15 mc14 mc13 mc12 mc11 mc10 mc9 mc8 read/write r/w after reset 0 0 0 0 0 0 0 0 figure 3.12.9 mailbox configuration register bits 0 to 15 in this register corresponds to mailboxes 0 to 15, respectively. each mailbox can be either enabled or disabled. 1) when = 1, access to mailbox n is enabled for the can controller. 2) when = 0, access to mailbox n is disabled for the can controller. a write of 0 or 1 is immediately reflected in the state of the bit. to change the state of from 1 (access enabled) to 0 (access disabled), first ensure that the corresponding trs bit is 0 before writing a 0 to . the control field in a transmit mailbox for which mbnmi0h = 1 and the message id field can only be written after the bit is cleared to 0. the data and control fields in a transmit mailbox for which = 0 can be written regardless of whether access to the mailbox is enabled or disabled (if = 1, however, it is necessary to ensure that the trs bit is 0 before writing to the register). if is cleared to 0 while the can cont roller is receiving data, it stops receiving that frame immediately. when the can controll er is transmitting data (trs = 1), do not clear to 0 before the transm ission is completed (trs = 0).
tmp92cd54i 2009-12-26 92cd54i-226 tentative mailbox direction register (md) mailbox direction register low 7 6 5 4 3 2 1 0 mdl (0302h) bit symbol md7 md6 md5 md4 md3 md2 md1 md0 read/write r/w after reset 0 0 0 0 0 0 0 0 mailbox direction register high 15 14 13 12 11 10 9 8 mdh (0303h) bit symbol md15 md14 md13 md12 md11 md10 md9 md8 read/write r r/w after reset 1 0 0 0 0 0 0 0 figure 3.12.10 mailbox direction register bits 0 to 15 in this register corresponds to mailboxes 0 to 15, respectively. each mailbox can be specified as either a transmit or receive mailbox. setting to 0 causes mailbox n to be used as a transmit mailbox. setting to 1 causes mailbox n to be used as a receive mailbox. the bit is read-only and fixed to 0 be cause mailbox 15 is used only for reception. the md register should be set as part of initialization. to modify settings in the md register, first set the corr esponding bit to 0. (2) transmission control registers when data and an id have been written to mailbox n which has been set as a transmit mailbox (md = 0) and the access to mailbox n is enabled (mc = 1), setting the trs bit to 1 causes a message in the mailbox to be transmitted. if there is more than one transmit request, messages are tr ansmitted sequentially. the order in which messages are transmitted depends on bit 3 () in the master control register, mcr. if the mcr bit is set to 1, a message is transmitted from the mailbox having the id assigned the highest priority among the mailboxes with transmission requests. after the occurrence of arbitration lost, a message is also transmitted from the mailbox having the id assigned the highest priority among th e mailboxes for which transmission requests are pending at that time. if the mcr bit is set to 0, mailbo xes having smaller mailbox numbers have higher priority. for example, if mb0, mb2 and mb5 are specified as transmit mailboxes with their trs bits set to 1, messages are transmitted in the following order: mb0, mb2 and mb5. if a new transmit request is se t for mb0 while a message from mb2 is being processed, the next internal arbitration proc ess selects mb0 for a ne xt transmit message, and starts transmitting an mb0 message afte r completing transmi ssion for mb2. this procedure also applies if arbitration lost o ccurs during message transmission for mb2. a message for mb0 is transmitted in place of that for mb2.
tmp92cd54i 2009-12-26 92cd54i-227 tentative transmit request set register (trs) transmit request set register low 7 6 5 4 3 2 1 0 trsl (0304h) bit symbol trs7 trs6 trs5 trs4 trs3 trs2 trs1 trs0 read/write r/s after reset 0 0 0 0 0 0 0 0 transmit request set register high 15 14 13 12 11 10 9 8 trsh (0305h) bit symbol trs14 trs13 trs12 trs11 trs10 trs9 trs8 read/write r/s after reset 0 0 0 0 0 0 0 figure 3.12.11 transmit request set register bits 0 to 15 in this register corresponds to mailboxes 0 to 15, respectively. the register does not have bit 15 because mailbox 15 is receive-only. the trs bit is cleared to 0 if transmi ssion is successful or if the transmission request is reset by setting the trr bit to 1. if transmission fails, transmission is retried until if it is successful or if the transmission request is reset by setting the trr bit to 1. mailbox n should not be written when the trs bit is set to 1. if mailbox n is set as a receive mailbo x, the cpu cannot set the trs bit. if mailbox n is set as a transmit mailbox, the trs bit is set to 1 when the cpu writes a 1 to it and cleared to 0 by the internal logic. a write of 0 by the cpu is invalid. read- modify- write not allowed read- modify- write not allowed
tmp92cd54i 2009-12-26 92cd54i-228 tentative transmit request reset register (trr) transmit request reset register low 7 6 5 4 3 2 1 0 trrl (0306h) bit symbol trr7 trr6 trr5 trr4 trr3 trr2 trr1 trr0 read/write r/s after reset 0 0 0 0 0 0 0 0 transmit request reset register high 15 14 13 12 11 10 9 8 trrh (0307h) bit symbol trr14 trr13 trr12 trr11 trr10 trr9 trr8 read/write r/s after reset 0 0 0 0 0 0 0 figure 3.12.12 transmit request reset register bits 0 to 15 in this register corresponds to mailboxes 0 to 15, respectively. the register does not have bit 15 because mailbox 15 is receive-only. setting the bit to 1 cancels the transmit request set with the corresponding trs bit. the operation, however, depends on which of the following three conditions applies: a. if the transmission of a message has not yet started, the message transmission request is canceled. (trs = 0, trr = 0, and aa = 1) b. if a message is currently being transmitte d and if arbitration lost or an error is detected, the message transmission request is cleared and the transmission is stopped. (trs = 0, trr = 0, and aa = 1) c. if a message is currently being transmitte d without arbitration lost or an error being detected, the message transmi ssion request is not cleared and the transmission is completed. (trs = 0, trr = 0, and ta = 1) mailbox n should not be written when the trr bit is set to 1. if mailbox n is set as a receive mailbo x, the cpu cannot set the trr bit. if mailbox n is set as a transmit mailbox, the trr bit is set to 1 when the cpu writes a 1 to it and cleared to 0 by the internal logic when transmission is either successful or aborted. a write of 0 by the cpu is invalid. read- modify- write not allowed read- modify- write not allowed
tmp92cd54i 2009-12-26 92cd54i-229 tentative transmit acknowledge register (ta) transmit acknowledge register low 7 6 5 4 3 2 1 0 tal (0308h) bit symbol ta7 ta6 ta 5 ta4 ta3 ta2 ta1 ta0 read/write r/c after reset 0 0 0 0 0 0 0 0 transmit acknowledge register high 15 14 13 12 11 10 9 8 tah (0309h) bit symbol ta14 ta13 ta12 ta11 ta10 ta9 ta8 read/write r/c after reset 0 0 0 0 0 0 0 figure 3.12.13 transmit acknowledge register bits 0 to 15 in this register corresponds to mailboxes 0 to 15, respectively. the register does not have bit 15 because mailbox 15 is receive-only. if a message in mailbox n has been transmitted successfully, the bit is set to 1 and a transmission completion interrupt (intct) occurs if it is enabled. the bit is cleared to 0 when the cpu writes a 1 to the or trs bit. a write of 0 by the cpu is invalid. abort acknowledge register (aa) abort acknowledge register low 7 6 5 4 3 2 1 0 aal (030ah) bit symbol aa7 aa6 aa5 aa4 aa3 aa2 aa1 aa0 read/write r/c after reset 0 0 0 0 0 0 0 0 abort acknowledge register high 15 14 13 12 11 10 9 8 aah (030bh) bit symbol aa14 aa13 aa12 aa11 aa10 aa9 aa8 read/write r/c after reset 0 0 0 0 0 0 0 figure 3.12.14 transmit acknowledge register bits 0 to 15 in this register corresponds to mailboxes 0 to 15, respectively. the register does not have bit 15 because mailbox 15 is receive-only. if message transmission for mailbox n has been canceled, the bit and the bit in the global interrupt flag regist er (gif) are set to 1. at that time, a global interrupt (transmission abort), intcg, occurs if a transmission abort interrupt has been enabled by setting the gim bit to 1. the bit is cleared to 0 when the cpu writes a 1 to the or trs bit. a write of 0 by the cpu is invalid. read- modify- write not allowed read- modify- write not allowed read- modify- write not allowed read- modify- write not allowed
tmp92cd54i 2009-12-26 92cd54i-230 tentative change data request register (cdr) change data request register low 7 6 5 4 3 2 1 0 cdrl (032ah) bit symbol cdr7 cdr6 cdr5 cdr4 cdr3 cdr2 cdr1 cdr0 read/write r/w after reset 0 0 0 0 0 0 0 0 change data request register high 15 14 13 12 11 10 9 8 cdrh (032bh) bit symbol cdr14 cdr13 cdr12 cdr11 cdr10 cdr9 cdr8 read/write r/w after reset 0 0 0 0 0 0 0 figure 3.12.15 change data request register bits 0 to 15 in this register corresponds to mailboxes 0 to 15, respectively. the register does not have bit 15 because mailbox 15 is receive-only. a transmission request for mailbox n is ignored if the bit is set to 1. in other words, if the trs and bits are set to 1 for mailbox n, a transmission request for the mailbox is temporarily held and a message is not transmitted unless transmission has already been started. once th e bit is cleared, mailbox n is again subject to internal arbitration. the function of the bit is valid when updating data fields in a transmission mailbox for which automatic response to a re mote frame is enabled (mbnmi0h = 1). using the automatic response function may result in a data field being updated during transmission because data transmission is star ted in response to a remote frame (in that case, updated data is output from an intermed iate point during transmission). to prevent such an update to a data field, the bit can be set to 1 to temporarily hold data transmission.
tmp92cd54i 2009-12-26 92cd54i-231 tentative (3) reception control registers the id of a received message is compared with the id of a mailbox specified as a receive mailbox. the comparison of ids depends on the values of the global/local receive mask enable bits (mbnmi0h /) in the mailbox and the data stored in the global/local receive mask registers (gam/lam). if a match is detected, the received id, control bits and data bytes are written to the matched mailbox. at this time, the corre sponding received message pending bit (rmp) is set to 1 and a reception completion interrupt (intcr) occurs if it is enabled. once a match is detected, ids are not compared subsequently. if a match is not detected, the message is rejected with the mailbox left intact. receive-only mailbox if the id of the received message does not match any of the ids of mailboxes 0 to 14, it is then compared with the id of receive-only mailbox 15. if a match is detected, the contents of the received message are stored into mailbox 15. received message pending register (rmp) received message pending register low 7 6 5 4 3 2 1 0 rmpl (030ch) bit symbol rmp7 rmp6 rmp5 rmp4 rmp3 rmp2 rmp1 rmp0 read/write r/c after reset 0 0 0 0 0 0 0 0 received message pending register high 15 14 13 12 11 10 9 8 rmph (030dh) bit symbol rmp15 rmp14 rmp13 rmp12 rmp11 rmp10 rmp9 rmp8 read/write r/c after reset 0 0 0 0 0 0 0 0 figure 3.12.16 received message pending register bits 0 to 15 in this register corresponds to mailboxes 0 to 15, respectively. the bit is set to 1 once a message has been received and its contents stored in mailbox n. after reading the received data, write a 1 to the rmp bit to clear the bit. if the mailbox receives a next message with the rmp bit still set to 1, the corresponding bit in the received message lost register (rml) is set to 1. in such a case, the data stored in mailbox n is overwritten with new data. a global interrupt (received message lost), intcg, also occurs if a received message lo st interrupt has been enabled by setting the gim bit to 1. the bit is set to 1 by the internal lo gic and cleared to 0 when the cpu writes a 1 to the bit. a write of 0 to the bit by the cpu is invalid. read- modify- write not allowed read- modify- write not allowed
tmp92cd54i 2009-12-26 92cd54i-232 tentative received message lost register (rml) received message lost register low 7 6 5 4 3 2 1 0 rmll (030eh) bit symbol rml7 rml6 rml5 rml4 rml3 rml2 rml1 rml0 read/write r after reset 0 0 0 0 0 0 0 0 received message lost register high 15 14 13 12 11 10 9 8 rmlh (030fh) bit symbol rml15 rml14 rml13 rml12 rml11 rml10 rml9 rml8 read/write r after reset 0 0 0 0 0 0 0 0 figure 3.12.17 received message lost register bits 0 to 15 in this register corresponds to mailboxes 0 to 15, respectively. if a mailbox for which the rmp bit is set to 1 receives a next message, the mailbox is overwritten with the new data and the bit set to 1. the bit is set to 1 by the internal logi c. it is cleared to 0 by the internal logic when the cpu writes a 1 to the rmp bit. a write of 1 or 0 to the bit by the cpu is invalid. table 3.12.2 operation when message is received before after id operation unmatched don?t care no change no change the data in receive buffer hasn?t been transferred to any mailbox. 0 1 no change the data in receive buffer is transferred to a mailbox which matched the identifier of incoming message. (old data in the mailbox was read out, and cleared to 0. then, the mailbox is written with new data; receive message pending bit is set.) matched 1 1 1 the data in receive buffer is transferred to a mailbox which matched the identifier of incoming message (old data is in the mailbox. then, the mailbox is overwritten with new data; receive message lost bit and receive message pending bit are set).
tmp92cd54i 2009-12-26 92cd54i-233 tentative (4) remote frame control registers when a remote frame is received, it is compared with the ids of all mailboxes. the comparison of ids depends on the values of the global/local receive mask enable bits (mbnmi0l /) in the mailbox and the data stored in the global/local receive mask registers (gam/lam). if it matches the id of transmit mailbox n for which the mbnmi0h bit is set to 1, the trs bit is set to 1 to tran smit a message in resp onse to the remote message. a transmit mailbox wi th the mbnmi0h bit set to 0 does not response to the remote frame even if it has the matched id. if the id matches that of a receive mailbo x, the remote frame is handled as a data frame and the rmp and rfp bits are set to 1. once a match is detected, subsequent ids are not compared. table 3.12.3 operation when remote frame is received id mailbox bit handling of remote frame matched transmit 0 not responded to. 1 responded to. ( bit is set) *note receive 1/0 not responded to. processed as data frame. ( and bits are set.) unmatched transmit/receive 1/0 not responded to. note: if the id matches that of a mailbox with mbnmi0l< game>=1, the id of the ma ilbox is overwritten with the remote frame id and automatic response is perform ed with that id. therefore, a response may be made to more than one id for a single mailbox. remote frame pending register (rfp) remote frame pending register low 7 6 5 4 3 2 1 0 rfpl (032ch) bit symbol rfp7 rfp6 rfp5 rfp4 rfp3 rfp2 rfp1 rfp0 read/write r after reset 0 0 0 0 0 0 0 0 remote frame pending register high 15 14 13 12 11 10 9 8 rfph (032dh) bit symbol rfp15 rfp14 rfp13 rfp12 rfp11 rfp10 rfp9 rfp8 read/write r after reset 0 0 0 0 0 0 0 0 figure 3.12.18 remote frame control register if mailbox n that is set as a receive mail box receives a remote frame, the and rmp bits are set to 1. the bit is cleared to 0 when the cpu writes a 1 to the bit. a write of 0 is invalid. the bit is also cleared to 0 if mailbox n that has received a remote frame receives a data frame and is overwritten.
tmp92cd54i 2009-12-26 92cd54i-234 tentative (5) receive filter registers the global receive mask registers, gam0 and gam1, are used to filter messages when the mbnmi0h bit is set to 1 for mailboxes 0 to 14. the received message is stored into the first mailbox with its id matched. only if the id does not match any of mailboxes 0 to 14, the received message is compared with receive-only mailbox 15. the local receive mask registers, lam0 and lam1, are used to filter messages when the mbnmi0h bit is set to 1 for mailbox 15. mailbox identifier acceptance mask register receive request received message identifier figure 3.12.19 acceptance filter
tmp92cd54i 2009-12-26 92cd54i-235 tentative local receive mask registers (lam0 and lam1) local receive mask register 0 low 7 6 5 4 3 2 1 0 lam0l (0310h) bit symbol lam23 lam22 lam21 lam20 lam19 lam18 lam17 lam16 read/write r/w after reset 0 0 0 0 0 0 0 0 local receive mask register 0 high 15 14 13 12 11 10 9 8 lam0h (0311h) bit symbol lami lam28 lam27 lam26 lam25 lam24 read/write r/w r/w after reset 0 0 0 0 0 0 local receive mask register 1 low 7 6 5 4 3 2 1 0 lam1l (0312h) bit symbol lam7 lam6 lam5 lam4 lam3 lam2 lam1 lam0 read/write r/w after reset 0 0 0 0 0 0 0 0 local receive mask register 1 high 15 14 13 12 11 10 9 8 lam1h (0313h) bit symbol lam15 lam14 lam13 lam12 lam11 lam10 lam9 lam8 read/write r/w after reset 0 0 0 0 0 0 0 0 figure 3.12.20 local receive mask register the lam0 and lam1 registers are only used to filter messages for mailbox 15. these registers allow the user to locally mask any id bits of a received message for mailbox 15. a received message is first chec ked with mailboxes 0 to 14 for a match before compared with mailbox 15. if the bit is set to 0, a message is received only when the corresponding bit of the received message id matches the corresponding bit of the mailbox id. if the bit is set to 1, a message is received regardless of whether the corresponding bit of the received message id is 0 or 1. the gam0 an d gam1 register do not affect mailbox 15. for the extended format, the mbnmi0h bit and all 29 bits of the id are compared. for the standard format, the mbnmi0h bit and the first 11 bits of the id ( to ) are compared. the bit (local receive mask id extension bit) is a mask bit for the mb15mi0h bit for mailbox 15. if the bit is set to 0, messages in either the standard or extended format is received depending on the mb15mi0h bit for mailbox 15. if the bit is set to 1, messages in the standard and extended formats are received regardless of the value of the mb15 mi0h bit for mailbox 15. for messages in the extended format, all 29 bits of the mailbox id and all 29 mask bits in the lam register are used for filtering. for messages in the standard form at, only the first 11 bits of the mailbox id ( to ) and the firs t 11 bits in the lam register ( to ) are used.
tmp92cd54i 2009-12-26 92cd54i-236 tentative the lam0 and lam1 registers can only be set during initialization and should not be modified during operation. if their settings are modified during reception, modified receive mask information becomes valid for message id comparison halfway through the reception. global receive mask registers (gam0 and gam1) global receive mask register 0 low 7 6 5 4 3 2 1 0 gam0l (0314h) bit symbol gam23 gam22 gam2 1 gam20 gam19 gam18 gam17 gam16 read/write r/w after reset 0 0 0 0 0 0 0 0 global receive mask register 0 high 15 14 13 12 11 10 9 8 gam0h (0315h) bit symbol gami gam28 gam27 gam26 gam25 gam24 read/write r/w r/w after reset 0 0 0 0 0 0 global receive mask register 1 low 7 6 5 4 3 2 1 0 gam1l (0316h) bit symbol gam7 gam6 gam5 gam4 gam3 gam2 gam1 gam0 read/write r/w after reset 0 0 0 0 0 0 0 0 global receive mask register 1 high 15 14 13 12 11 10 9 8 gam1h (0317h) bit symbol gam15 gam14 gam1 3 gam12 gam11 gam10 gam9 gam8 read/write r/w after reset 0 0 0 0 0 0 0 0 figure 3.12.21 global receive mask register the gam0 and gam1 registers are used to filter messages for mailboxes 0 to 14. the gam0 and gam1 registers are used for received messages when the mbnmi0h bit is set to 1 for mailboxes 0 to 14. the received message is stored only into the first mailbox with its id matched. if the mbnmi0h bit is set to 0, a message is received only when the corresponding bit of the received message id matches the corresponding bit of the mailbox id. if the mbnmi0h bit is set to 1, a message is received regardless of whether the corresponding bit of the received message id is 0 or 1. for the extended format, the mbnmi0h bit and all 29 bits of the id are compared. for the standard format, the mbnmi0h bit and the first 11 bits of the id ( to ) are compared. the bit (global receive mask id exte nsion bit) is a mask bit for the mbnmi0h bit for mailboxes 0 to 14. if the bit is set to 0, messages in either the standard or extended format is received depending on the mbnmi0h bit for mailboxes 0 to 14. if the bit is set to 1, messages in the standard and extended formats are received regardless of the value of the mbnmi0h bit for mailboxes 0 to 14. for
tmp92cd54i 2009-12-26 92cd54i-237 tentative messages in the extended format, all 29 bits of the mailbox id and all 29 mask bits in the gam register are used for filtering. for message s in the standard format, only the first 11 bits of the mailbox id ( to ) and the first 11 bits in the gam register ( to ) are used. the gam0 and gam1 registers can only be set during initialization and should not be modified during operation. if their settings are modified during reception, modified receive mask information becomes valid for message id comparison halfway through the reception. (6) control registers master control register (mcr) master control register low 7 6 5 4 3 2 1 0 mcrl (0318h) bit symbol ccr smr hmr wuba mtos tscc sres read/write r/w w after reset 1 0 0 0 0 0 0 master control register high 15 14 13 12 11 10 9 8 mcrh (0319h) bit symbol tstlb tsterr read/write r/w after reset 0 0 figure 3.12.22 master control register tstlb: test loopback 0: cancels test loopback mode. (normal operation) 1: requests test loopback mode. this mode supports stand-alone operation. tsterr: test error 0: cancels test error mode. (normal operation) 1: requests test error mode. this mode enables a write to the error counter register (cec). ccr: change configuration request 0: cancels configuration mode. (normal operation) 1: requests configuration mode. this mode enables a write to the bit configuration registers (bcr1 and bcr2). smr: sleep mode request 0: releases sleep mode. (normal operation) 1: requests sleep mode. in this mode, the can controller clock is st opped and the error counter and transmit requests are reset. hmr: halt mode request 0: releases halt mode. (normal operation) 1: requests halt mode. in this mode, the can controller does not trans mit or receive messages. it only transmits error flags and acknowledge flags.
tmp92cd54i 2009-12-26 92cd54i-238 tentative wuba: wakeup on bus activity 0: wakes up only with write access to the mcr register. 1: wakes up either upon the detection of a bus active state or with write access to the mcr register. mtos: mailbox transmission order select 0: transmits messages in ascending order of the mailbox number. 1: transmits messages in the order of the message id priority. tscc: timestamp counter clear 0: invalid 1: clears the timestamp counter to 0. note 1: this bit is write-only. when read, it always returns 0. note 2: the timestamp counter is also cleared with a write to the tsp register or a write of 0 to the timestamp counter (tsc). sres: software reset 0: invalid 1: applies a software reset to the can c ontroller. it initializes all the registers. note 1: this bit is write-only. when read, it always returns 0. bit configuration register 1 (bcr1) bit configuration register 1 low 7 6 5 4 3 2 1 0 bcr1l (031ch) bit symbol brp7 brp6 brp5 brp4 brp3 brp2 brp1 brp0 read/write r/w after reset 0 0 0 0 0 0 0 0 specify the value of the baud rate prescaler. a value of 0 to 255 can be set. bit configuration register 1 high 15 14 13 12 11 10 9 8 bcr1h (031dh) bit symbol read/write after reset figure 3.12.23 bit configuration register 1
tmp92cd54i 2009-12-26 92cd54i-239 tentative bit configuration register 2 (bcr2) bit configuration register 2 low 7 6 5 4 3 2 1 0 bcr2l (031eh) bit symbol sam tseg22 tseg21 tseg20 tseg13 tseg12 tseg11 tseg10 read/write r/w after reset 0 0 0 0 0 0 0 0 setting of sam setting of tseg2 setting of tseg1 sampling time unit time of tscl unit time of tscl 0 1 000 not available 0000 not available 1 3 001 2 tscl 0001 2 tscl 010 3 tscl 0010 3 tscl 011 4 tscl 0011 4 tscl 100 5 tscl 0100 5 tscl 101 6 tscl 0101 6 tscl 110 7 tscl 0110 7 tscl 111 8 tscl 0111 8 tscl 1000 9 tscl 1001 10 tscl 1010 11 tscl 1011 12 tscl 1100 13 tscl 1101 14 tscl 1110 15 tscl 1111 16 tscl bit configuration register 2 high 15 14 13 12 11 10 9 8 bcr2h (031fh) bit symbol sjw1 sjw0 read/write r/w after reset 0 0 setting of sjw adjust time 00 1 tscl 01 2 tscl 10 3 tscl 11 4 tscl figure 3.12.24 bit configuration register 2 the bit length is determined from the parameters in bcr2l, , and bcr1l. all can controllers on the can bus must operate at the same baud rate. if the operating frequency differs between can controllers, adjust the baud rate using the above parameters. the bit timi ng circuit provides requested bit timings by converting parameters appropriately. the bcr1 and bcr2 registers contain data related to bit timings.
tmp92cd54i 2009-12-26 92cd54i-240 tentative figure 3.12.25 bit timing the value of tscl is obtained from the following expression: tscl = ( + 1)/f io (where f io is a clock obtained by halving an external clock.) f io is the input clock for the can controller. the single-bit length is determined from the following expression: single-bit length = syncseg + tseg1 + tseg2 the single-bit length should be set so that it is greater than or equal to 10/f io . the length of the synchronization segment (syncseg) is always 1 tscl. for tseg1, specify a value of tseg2 or greater. tseg1 tseg2 the baud rate is obtained from the following expression: baud rate = f io [( + 1) (( + 1) + ( + 1) + 1)] ipt (information processing time) is a time segment starting from the sample point and represents the time required to process a bit read. ipt = 3 / f io sjw indicates the tscl time by which the bit length can be increased or reduced during resynchronization. timing is always synchronized on the rising edge of a signal on the bus. for sjw, specify a value of tseg2 or less. sjw tseg2 setting the bit enables multisampling on the bus according to the bit timing. the level is determined based on majority rule from three sampled values. if < 4, three samples cannot be used. if < 4, only a single sampling is performed regardless of the bit setting. the following restrictions are imposed on the baud rate prescaler: table 3.12.4 baud rate prescaler tscl length (can clock cycles : f io ) ipt length (can clock cycles : f io ) tseg2 minimum length (tscl) 0 1 3 3 1 2 3 2 > 1 +1 3 2 syncseg sjw sjw tseg1 tseg2 1 bit time sam p le point ipt tscl
tmp92cd54i 2009-12-26 92cd54i-241 tentative example1: setting a baud rate of 1 mbps (1-bit length = 1 s) can clock frequency: f io = 10 mhz baud rate prescaler: bcr1l = 00h since tscl = 0.1 s, the single-bit length for data transmission should be programmed with 10 tscl. the following shows example parameter settings for that purpose. program tseg1 + tseg2 = 9 tscl because syncseg = 1 tscl. bcr2l = 0100b (5 tscl) bcr2l = 011b (4 tscl) multisampling on the bus cannot be used because = 00h, which is less than 4. therefore, set the bit to 0. sjw cannot be set to a value greater than tseg2. in this case, however, sjw can be set to the maximum value. bcr2h = 11b (4 tscl) example2: setting a baud rate of 500 kbps (1-bit length = 2 s) sample point: 80% can clock frequency: f io = 10 mhz (a) when bcr1l = 00h tscl = (+1) / f io = 1 / 10 mhz = 0.1 s therefore, the single-bit length for data transmission should be programmed with 20 tscl. to set the sample point to 80%: tseg2 = (20 tscl) 0.2 = 4 tscl therefore, the bcr2l register bits are set as follows: bcr2l = 1110b (15 tscl) bcr2l = 011b (4 tscl) (b) when bcr1l = 01h tscl = (+1) / f io = 2 / 10 mhz = 0.2 s therefore, the single-bit length for data transmission should be programmed with 10 tscl. to set the sample point to 80%: tseg2 = (10 tscl) 0.2 = 2 tscl therefore, the bcr2l register bits are set as follows: bcr2l = 0110b (7 tscl) bcr2l = 001b (2 tscl) example3: setting a baud rate of 500 kbps (1-bit length = 2 s) sample point: 85% can clock frequency: f io = 10 mhz (a) when bcr1l = 00h tscl = (+1) / f io = 1 / 10 mhz = 0.1 s therefore, the single-bit length for data transmission should be programmed with 20 tscl. to set the sample point to 85%: tseg2 = (20 tscl) 0.15 = 3 tscl
tmp92cd54i 2009-12-26 92cd54i-242 tentative therefore, the bcr2l register bits are set as follows: bcr2l = 1111b (16 tscl) bcr2l = 010b (3 tscl) timestamp function the can controller has a 16-bit free-running timestamp counter, tsc, to determine the time at which a message was transmitted or received. upon the completion of storing a received message or transmitting a message, the value of the tsc is written to the timestamp value, tsv, for the corresponding mailbox. the bit clock on the can bus line is supplied through the prescaler to the tsc. the tsc is stopped in configuration mode or sleep mode. upon reset, the tsc is cleared to 0 by a write to the timestamp counter prescaler register, tsp. the cpu can read and write to the tsc in configuration mode or normal operation mode. timestamp counter register (tsc) time stamp counter register low 7 6 5 4 3 2 1 0 tscl (0332h) bit symbol tsc7 tsc6 tsc5 tsc4 tsc3 tsc2 tsc1 tsc0 read/write r/w after reset 0 0 0 0 0 0 0 0 time stamp counter register high 15 14 13 12 11 10 9 8 tsch (0333h) bit symbol tsc15 tsc14 tsc13 tsc12 tsc11 tsc10 tsc9 tsc8 read/write r/w after reset 0 0 0 0 0 0 0 0 figure 3.12.26 timestamp counter register a tsc overflow can be detected using the flag in the gsr register and the flag in the gif register. both flags are cleared to 0 by a write of a 1 to the flag in the gif register. a 4-bit prescaler is provided for the tsc. the value to be reloaded to the prescaler is specified with the timestamp counter prescaler register, tsp. upon a reset, the tsp is cleared to 0 and the prescaler is also load ed with 0. the following shows the count-up period, ttsc, for the tsc: ttsc = tbit ( + 1) (where tbit is a bit period) read- modify- write not allowed read- modify- write not allowed
tmp92cd54i 2009-12-26 92cd54i-243 tentative timestamp counter prescaler register (tsp) time stamp counter prescaler register low 7 6 5 4 3 2 1 0 tspl (0330h) bit symbol tsp3 tsp2 tsp1 tsp0 read/write r/w after reset 0 0 0 0 time stamp counter prescaler register high 15 14 13 12 11 10 9 8 tsph (0331h) bit symbol read/write after reset figure 3.12.27 timestamp counter register a hold register is implemented to prevent the value of the tsc from varying during a mailbox write cycle. when a message has been transmitted or received successfully, the value of the tsc is copied to the hold register, from which it is written to the mailbox. reception is successful for the receiver if the message does not contain an error except for the last end-of-frame bit. transm ission is successful for the tr ansmitter if the message does not contain an error including the last end-of-frame bit. figure 3.12.28 time stamp counter the timestamp counter register (tsc) and timestamp hold register are cleared under the following conditions: ? upon a reset (hardware/software) ? when the device enters configuration mode ? when the device enters sleep mode ? when write access is performed to the tsp register cpu read/write mailbox time stamp counter hold register (16bit) transmission successful time stamp counter register count-up clock hardware reset (4bit) prescaler re-load value time stamp counter prescaler register cpu read/write can bus bit clock reception successful software reset clear clear clear load hardware reset software reset entering sleep mode entering configuration mode write to tsp register
tmp92cd54i 2009-12-26 92cd54i-244 tentative (7) status registers global status register (gsr) global status register low 7 6 5 4 3 2 1 0 gsrl (031ah) bit symbol cce sma hma tso bo ep ew read/write r r after reset 1 0 0 0 0 0 0 global status register high 15 14 13 12 11 10 9 8 gsrh (031bh) bit symbol msginslot<3:0> rm tm read/write r after reset 1 1 1 1 0 0 figure 3.12.29 global status register if mailbox n that is set as a receive mail box receives a remote frame, the and rmp bits are set to 1. the bit is cleared to 0 when the cpu writes a 1 to the bit. a write of 0 is invalid. the bit is also cleared to 0 if mailbox n that has received a remote frame receives a data frame and is overwritten. msginslot: message in slot indicates the message contained in the transmit buffer. 0000: message from mailbox 0 0001: message from mailbox 1 : 1110: message from mailbox 14 1111: no message contained in the transmit buffer rm: receive mode 0: the can controller is not receiving a message. 1: the can controller is receiving a message. tm: transmit mode 0: the can controller is not transmitting a message. 1: the can controller is transmitting a message. cce: change configuration enable 0: the can controller is not placed in configuration mode. (normal operation) 1: the can controller is placed in configuration mode. sma: sleep mode acknowledge 0: the can controller is not placed in sleep mode. (normal operation) 1: the can controller is placed in sleep mode. hma: halt mode acknowledge 0: the can controller is not placed in halt mode. (normal operation) 1: the can controller is placed in halt mode.
tmp92cd54i 2009-12-26 92cd54i-245 tentative tso: timestamp overflow flag 0: the timestamp counter has not overflowed. 1: the timestamp counter has overflowed at least once after this bit was cleared to 0. to clear the bit to 0, clear the bit in the gif register to 0. bo: bus-off status 0: bus-on state (normal operation) 1: bus-off state the can controller enters the bus-off state if the transmit error counter (tec) reaches a limit of 256 due to abnormally frequent occurrence of erro rs on the can bus. in the bus-off state, messages cannot be transmitted or received. the error counter is undefined in that state. a bus-off recovery sequence causes the can cont roller to enter the bus-on state automatically. ep: error passive status 0: the can controller is placed in error active mode. the values of the transmit error counter (tec ) and receive error counter (rec) are both less than 128. 1: the can controller is placed in error passive mode. it indicates that either or both of the transmit error counter (tec) and receive error counter (rec) have reached 128, which indicates the error passive limit. ew: warning status 0: the values of the transmit error counter (t ec) and receive error counter (rec) are both less than or equal to 96. 1: it indicates that either or both of the transmi t error counter (tec) and receive error counter (rec) have exceeded 96, which indicates a warning level. can error counter register (cec) can error counter register low cecl (032eh) 7 6 5 4 3 2 1 0 bit symbol rec7 rec6 rec5 rec4 rec3 rec2 rec1 rec0 read/write r/w after reset 0 0 0 0 0 0 0 0 can error counter register high cech (032fh) 15 14 13 12 11 10 9 8 bit symbol tec7 tec6 tec5 tec4 tec3 tec2 tec1 tec0 read/write r/w after reset 0 0 0 0 0 0 0 0 figure 3.12.30 can error counter register the can controller has two error counters, th e receive error counter (rec) and transmit error counter (tec). the cpu can read the valu es of both error counters. error counters can only be written in test error mode (when the bit in the mcr register is set to 1). when writing to the cec register, writ ing a value to the lower eight bits (cecl) causes the same value to be also written to the upper eight bits (cech). a write to the upper eight bits (cech) is invalid. error counters are incremented or decremented according to can version 2.0b. the can controller is placed in one of the following three states depending on the values of rec and tec: read- modify- write not allowed read- modify- write not allowed
tmp92cd54i 2009-12-26 92cd54i-246 tentative (1) error active status (if tec < 128 and rec < 128) the can controller enters this state upon a reset release. in this state, it transmits an active error flag if it detects an error. (2) error passive status (if tec 128 or rec = 128) in this state, the can controller transmits a passive error flag if it detects an error. (3) bus-off state (if tec 256) in this state, the can controller cannot transmit or receive messages. the value of rec does not exceed the error passive limit (128). when rec = 128, a successful reception of another message causes the rec to be set back to a value of between 119 and 127. when the can controller enters th e bus-off state, both of the count values become undefined. once placed in the bus-off state, the can co ntroller automatically returns to the error active state if it detects a sequence of eleven recessive bits 128 times. both error counters are cleared to 0 when the can controller enters configuration mode. for details, see "3.12.4( 1) configuration mode." (8) interrupt control registers the can controller supports the following interrupt sources: ? transmit interrupt occurs upon the completion of message transmission. ? receive interrupt occurs upon the completion of message reception. ? remote frame receive interrupt occurs when a remote frame is received. ? wakeup interrupt occurs upon a wakeup from sleep mode. ? received message lost interrupt occurs upon the detection of received message lost. ? transmission abort interrupt occurs when message transmi ssion is aborted (when a bit in the aa register is set to 1). ? timestamp counter overflow interrupt occurs when the timestamp counter overflows. ? bus-off interrupt occurs when the can controller enters the bus-off state. ? error passive interrupt occurs when the can controller enters the error passive state. ? warning interrupt occurs when either of the two error counters has exceeded 96, reaching a warning level.
tmp92cd54i 2009-12-26 92cd54i-247 tentative these interrupt sources are classified into the following three groups: ? reception completion interrupt (intcr) ? transmission completi on interrupt (intct) ? global interrupt (intcg) each interrupt group has a single interrupt output signal assigned. an intcr interrupt occurs upon the completion of reception. an intct interrupt occurs upon the completion of transmission. an intcg interrupt occurs for any other reasons. mailbox interrupts
tmp92cd54i 2009-12-26 92cd54i-248 tentative global interrupt global interrupt, intcg is provided by any interrupt reasons except a mailbox transmission completion and a mailbox reception completion. the global interrupt flag register, gif, is provided for global interrupt . the global interrupt mask register, gim, is also provided to enable or disable global interrupt. global interrupt flag register (gif) global interrupt flag register low gifl (0320h) 7 6 5 4 3 2 1 0 bit symbol rfpf wuif rmlif trmabf tsoif boif epif wlif read/write r/c after reset 0 0 0 0 0 0 0 0 global interrupt flag register high gifh (0321h) 15 14 13 12 11 10 9 8 bit symbol read/write after reset figure 3.12.31 global interrupt flag register each interrupt flag in the global interrupt fl ag register (gif) is set if the corresponding global interrupt condition is satisfied. a global interrupt flag being set to 1 causes a global interrupt pulse, intcg, to be generated if the corresponding bit in the interrupt mask register (gim) is set to 1 (interrupt enabled). if the interrupt condition for the same source is satisfied subsequently, a global interrupt pulse (intcg) is not generated as long as the interrupt flag in the gif register is set to 1. when global interrupt flag is cleared to 0, if another flag has been set to 1, new global interrupt pulse (intcg) is generated. each interrupt flag in the gif register which is set to 1 is cleared to 0 when the cpu writes a 1 to the flag. a write of 0 is invalid. rfpf: remote frame pending flag 0: a remote frame has not been received. 1: a remote frame has been received (to a receive mailbox). the bit is not, however, set to 1 if the id matches that of a transmit mailbox for which the bit is set to 1. wuif: wakeup interrupt flag 0: the can controller is placed in either sleep mode or normal operation mode. 1: the can controller has woken up from sleep mode. read- modify- write not allowed read- modify- write not allowed
tmp92cd54i 2009-12-26 92cd54i-249 tentative rmlif: received message lost interrupt flag 0: received message lo st has not occurred. 1: received message lost has occurred in at l east one receive mailbox. at least one bit in the rml register is set to 1. trmabf: transmission abort flag 0: transmission abort has not occurred. 1: transmission abort has occurred. at least one bit in the aa register is set to 1. tsoif: timestamp counter overflow interrupt flag 0: no timestamp counter overflow has occurred since this bit was cleared. 1: a timestamp counter overflow has occurr ed at least once since this bit was cleared. boif: bus-off interrupt flag 0: the can controller is placed in bus-on mode. 1: the can controller is placed in bus-off mode. epif: error passive interrupt flag 0: the can controller is placed in error active mode. 1: the can controller is placed in error passive mode. wlif: warning level interrupt flag 0: no error counter has reached a warning level. 1: at least one of the error counters has reached a warning level. global interrupt mask register (gim) global interrupt mask register low 7 6 5 4 3 2 1 0 giml (0322h) bit symbol rfpm wuim rmlim trmabm tsoim boim epim wlim read/write r/w after reset 0 0 0 0 0 0 0 0 global interrupt mask register high 15 14 13 12 11 10 9 8 gimh (0323h) bit symbol read/write after reset figure 3.12.32 global interrupt mask register the global interrupt mask register (gim) enables or disables global interrupts for each interrupt condition in the gif register. glob al interrupts for an interrupt condition are disabled when the corresponding bit in the gim register is set to 0 and enabled when it is set to 1. upon a reset, all bits in the register are cleared to 0, thus disabling global interrupts.
tmp92cd54i 2009-12-26 92cd54i-250 tentative mailbox interrupts besides global interrupts, interrupts for mailboxes are provided. they include a mailbox transmission completion interrupt, intct, an d a mailbox reception completion interrupt, intcr, which depend on mailbox settings. the mailbox transmit interrupt flag register, mbtif, is provided for mailbox transmission completion interrupts. the mailbox receive interrupt flag register, mbrif, is provided for mailbox reception completion interrupts. the mailbox interrupt mask register, mbim, is also provided to enable or disable each mailbox interrupt. mailbox interrupt mask register (mbim) mailbox interrupt mask register low 7 6 5 4 3 2 1 0 mbiml (0328h) bit symbol mbim7 mbim6 mbim5 mbim4 mbim3 mbim2 mbim1 mbim0 read/write r/w after reset 0 0 0 0 0 0 0 0 mailbox interrupt mask register high 15 14 13 12 11 10 9 8 mbimh (0329h) bit symbol mbim15 mbim14 mbim13 mbim12 mbim11 mbim10 mbim9 mbim8 read/write r/w after reset 0 0 0 0 0 0 0 0 figure 3.12.33 mailbox interrupt mask register bits 0 to 15 in the mbim register correspo nds to mailboxes 0 to 15, respectively. the mbim register enables or disabl es an interrupt for each mailbox. if the bit is 0, an interrupt for the corresponding mailbox is disabled. if the bit is 1, an interrupt for the corresponding mailbox is enabled.
tmp92cd54i 2009-12-26 92cd54i-251 tentative mailbox transmit interrupt flag register (mbtif) mailbox transmit interr upt flag register low 7 6 5 4 3 2 1 0 mbtifl (0324h) bit symbol mbtif7 mbtif6 mbtif5 mbtif4 mbtif3 mbtif2 mbtif1 mbtif0 read/write r/c after reset 0 0 0 0 0 0 0 0 mailbox transmit interr upt flag register high 15 14 13 12 11 10 9 8 mbtifh (0325h) bit symbol mbtif14 mbtif13 mbtif12 mbtif11 mbtif10 mbtif9 mbtif8 read/write r/c after reset 0 0 0 0 0 0 0 figure 3.12.34 mailbox transmit interrupt flag register the mailbox transmit interrupt flag regi ster, mbtif, is provided for mailbox transmission completion interrupts. bits 0 to 15 in this register corre sponds to mailboxes 0 to 15, respectively. the mbtif register does not have bit 15 because mailbox 15 is receive-only. if mailbox n is set as a receive mailbox, the corresponding interrupt flag in the mbtif register is always read as 0. when a message in mailbox n has been transmitted, the flag is set to 1 and a mailbox transmission completion interrupt pulse (intct) is generated if the corresponding mask bit in the mbim register is set to 1 (interrupt enabled). if the corresponding mask bit in the mbim regi ster is set to 0, the completion of message transmission does not result in the flag being set or an intct interrupt being generated. to determine whether transmission has been completed, it is necessary to read the ta register. an intct interrupt pulse is generated when an interrupt flag in the mbtif register is set to 1. if another mailbox transmission completion interrupts condition occurs before that flag is cleared to 0, the corresponding interrupt flag in the mbtif register is set to 1 but an intct interrupt pulse is not generated. if an interrupt flag in the mbtif register is cleared to 0 with another interrupt flag still set to 1, an intct interrupt pulse is generated. an interrupt flag in the mbtif register is cleared to 0 when the cpu writes a 1 to the flag. a write of 0 is invalid. read- modify- write not allowed read- modify- write not allowed
tmp92cd54i 2009-12-26 92cd54i-252 tentative mailbox receive interrupt flag register (mbrif) mailbox receive interrupt flag register low 7 6 5 4 3 2 1 0 mbrifl (0326h) bit symbol mbrif7 mbrif6 mbrif5 mbrif4 mbrif3 mbrif2 mbrif1 mbrif0 read/write r/c after reset 0 0 0 0 0 0 0 0 mailbox receive interrupt flag register high 15 14 13 12 11 10 9 8 mbrifh (0327h) bit symbol mbrif15 mbrif14 mbrif13 mbrif12 mbrif11 mbrif10 mbrif9 mbrif8 read/write r/c after reset 0 0 0 0 0 0 0 0 figure 3.12.35 mailbox receive interrupt flag register the mailbox receive interrupt flag register, mbrif, is provided for mailbox reception completion interrupts. bits 0 to 15 in this register corresponds to mailboxes 0 to 15, respectively. if mailbox n is set as a transmit mailbox, the corresponding interrupt flag in the mbrif register is always read as 0. when a message for mailbox n has been receiv ed, the flag is set to 1 and a mailbox reception completion interrupt pulse (intcr) is generated if the corresponding mask bit in the mbim register is set to 1 (interrupt enabled). if the corresponding mask bit in the mbim regi ster is set to 0, the completion of message reception does not result in the flag being set or an intcr interrupt being generated. to determine whether reception has be en completed, it is necessary to read the rmp register. an intcr interrupt pulse is generated when an interrupt flag in the mbrif register is set to 1. if another mailbox reception completion interrupts condition occurs before that flag is cleared to 0, the corresponding interrupt flag in the mbrif register is set to 1 but an intcr interrupt pulse is not generated. if an interrupt flag in the mbrif register is cleared to 0 with another interrupt flag still set to 1, an intcr interrupt pulse is generated. an interrupt flag in the mbrif register is cleared to 0 when the cpu writes a 1 to the flag. a write of 0 is invalid. read- modify- write not allowed read- modify- write not allowed
tmp92cd54i 2009-12-26 92cd54i-253 tentative 3.12.4 description of operating modes (1) configuration mode the can controller requires initialization (by setting the bit configuration registers, bcr1 and bcr2) before it can start operation. the bcr1 and bcr2 registers can be written in configuration mode only. upon a reset, the can controller enters configuration mode if the bit in the mcr register and the bit in the gsr register are set to 1. writing a 0 to the mcrl bit places the controller in normal operation mode. when the can contro ller exits from configuration mode, the gsrl bit is set to 0 and a power-up sequence starts. in the power-up sequence, the can controller detects a sequence of eleven recessive bits on the can bus. it then enters the bus-on state and is ready to start operation. writing a 1 to the mcrl bit causes the can controller to exit from normal operation mode and enter configuration mode . when it enters configuration mode, the gsrl bit is set to 1. figure 3.12.36 shows a can initialization flowchart. in configuration mode, the error counte r (cec), timestamp counter (tsc), and timestamp hold register are cleared. reset switch to configuration mode from normal operation mode configuration mode = 1, = 1 normal operation mode = 0, = 0 set bit timing parameters in bcr1 & bcr2 configuration mode no requested? normal operation mode no yes requested? set to 1 yes set to 0 = 1? no yes = 0? no yes normal operation mode = 0, = 0 starts power-up sequence 11 consecutive recessive no bits detected? yes bus on figure 3.12.36 flowchart of can initialization
tmp92cd54i 2009-12-26 92cd54i-254 tentative (2) sleep mode writing a 1 to the bit in the mcr regi ster request a transition to sleep mode. when the can controller enters sleep mode, the bit in the gsr register is set to 1. in sleep mode, the clock for the can controller is stopped and only the wakeup circuit is active. the gsr register returns a value of f040h when it is read. it indicates that the transmit buffer contains no message and that sleep mode is active with the gsrl bit set to 1. all other registers are read as 0000h. write access is disabled for all registers other than mcr. if the can controller detects write access to the mcr register or detects a bus active state on the can bus when the bit in the mcr register is set to 1, it releases sleep mode (wakes up) and starts a power- up sequence. it waits until a sequence of eleven recessive bits are detected on the rx input pin and then enters a bus active state. the first message that has triggered a transition to a bus active state cannot be received. in sleep mode, the can error counter and all transmit request set (trs) bits and transmission request reset (trr


▲Up To Search▲   

 
Price & Availability of TMP92CD54IFG

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X